Huanyang VFD RS485 / Modbus

771 views
Skip to first unread message

OttoMeister

unread,
Jun 18, 2017, 11:25:29 AM6/18/17
to Machinekit
I am using an 2.2kW Huanyang frequency converter for my spindle on an BeagleBone black. It runs pretty fine with a old image (bone-debian-7.8-machinekit-armhf-2015-04-26-4gb.img.xz).
Now I try to update to an newer version of debian and machinekit, but i have some problems. If I compile the user space component for controlling a huanyang spindle, it compiles without trouble but wont communicate with the VFD. The newer version wont compile at all. My computer skills are not good enough to find the problem. So here are my question:
 
- Has anyone running an Huanyang VFD over Modbus with an actual version of machinkit?
- How about VFD over Modbus from different manufacturer?

Original thread on cnczone.org:
http://www.cnczone.com/forums/phase-converters/91847-software-3.html#post704008http://www.cnczone.com/forums/phase-converters/91847-huanyang-vfd-rs485-modbus-3.html#post704008

Final version before integrated in LinuxCNC:
https://github.com/bebro/linuxcnc-huanyang-vfd

Actual version integrated in LinuxCNC:
https://github.com/LinuxCNC/linuxcnc/tree/master/src/hal/user_comps/huanyang-vfd





Bildschirmfoto zu 2017-06-18 16-58-12.png

schoo...@btinternet.com

unread,
Jun 19, 2017, 6:31:19 AM6/19/17
to machi...@googlegroups.com

On 18/06/17 16:25, OttoMeister wrote:
I am using an 2.2kW Huanyang frequency converter for my spindle on an BeagleBone black. It runs pretty fine with a old image (bone-debian-7.8-machinekit-armhf-2015-04-26-4gb.img.xz).
Now I try to update to an newer version of debian and machinekit, but i have some problems. If I compile the user space component for controlling a huanyang spindle, it compiles without trouble but wont communicate with the VFD. The newer version wont compile at all.

What are you calling the 'newer version', do you mean the one in the linuxcnc repo?

How are you building it?
What errors do you get?

Inserting that sub dir into the MK source tree, builds the component without problems.
It is intended to be built within the source tree, not externally.

Since we don't have that component available, I will look at pulling it into the repo and then it will be available from packages too.

Testing will be down to you, I don't have one of these to try it on. ;-)

My computer skills are not good enough to find the problem. So here are my question:
 
- Has anyone running an Huanyang VFD over Modbus with an actual version of machinkit?
- How about VFD over Modbus from different manufacturer?

Original thread on cnczone.org:
http://www.cnczone.com/forums/phase-converters/91847-software-3.html#post704008http://www.cnczone.com/forums/phase-converters/91847-huanyang-vfd-rs485-modbus-3.html#post704008

Final version before integrated in LinuxCNC:
https://github.com/bebro/linuxcnc-huanyang-vfd

Actual version integrated in LinuxCNC:
https://github.com/LinuxCNC/linuxcnc/tree/master/src/hal/user_comps/huanyang-vfd





--
website: http://www.machinekit.io blog: http://blog.machinekit.io github: https://github.com/machinekit
---
You received this message because you are subscribed to the Google Groups "Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to machinekit+...@googlegroups.com.
Visit this group at https://groups.google.com/group/machinekit.
For more options, visit https://groups.google.com/d/optout.

Message has been deleted

OttoMeister

unread,
Jun 19, 2017, 4:05:25 PM6/19/17
to Machinekit


Old Image: image bone-debian-7.8-machinekit-armhf-2015-04-26-4gb.img.xz. No upgrade, no internet conection. Version of Machinekit in image: machinekit 0.1.1174-1da.bbot.pr593.git6ca42cf~1wheezy

Using standalone version of original thread on cnczone.org: http://www.cnczone.com/forums/phase-converters/91847-software-3.html#post704008http://www.cnczone.com/forums/phase-converters/91847-huanyang-vfd-rs485-modbus-3.html#post704008

Compile and run without problem.

Then I connect Internet and make update and upgrade, also update machinekit, machinekit-xenomai, and many more....

Neue Version: machinekit_0.1.1497866711-1mk.travis.master.git8df407f6~1wheezy_armhf.deb

Start machinekit:

spindle-vfd: device='/dev/ttyUSB0', baud=9600, bits=8, parity='none', stopbits=1, address=1, verbose=1, PID=1739

Opening /dev/ttyUSB0 at 9600 bauds (none)

./hy_vfd.bin: symbol lookup error: ./hy_vfd.bin: undefined symbol: hal_malloc

Now download again standalone version from cnczone.org. Compile without errors, start new bin exact same way like old bin. Loads with no error. Axis-Gui starts with no error but can not communicate.


I will download the source of machinekit and try to integrate the source from linux-cnc. But it will take some time to do so…..

schoo...@btinternet.com

unread,
Jun 20, 2017, 2:02:30 AM6/20/17
to machi...@googlegroups.com



On 19/06/2017 21:03, OttoMeister wrote:


Old Image:

image bone-debian-7.8-machinekit-armhf-2015-04-26-4gb.img.xz. No upgrade, no internet connection.

Version of Machinekit in image: machinekit 0.1.1174-1da.bbot.pr593.git6ca42cf~1wheezy


Compile and run without problem.


Then I connect Internet and make update and upgrade, also update machinekit, machinekit-xenomai, and many more, reboot.

Neue Version: machinekit_0.1.1497866711-1mk.travis.master.git8df407f6~1wheezy_armhf.deb


Start machinekit:

spindle-vfd: device='/dev/ttyUSB0', baud=9600, bits=8, parity='none', stopbits=1, address=1, verbose=1, PID=1739

Opening /dev/ttyUSB0 at 9600 bauds (none)

./hy_vfd.bin: symbol lookup error: ./hy_vfd.bin: undefined symbol: hal_malloc


Looks like it is not linked properly.


Now download again standalone version from cnczone.org. Compile without errors, start new bin exact same way like old bin. Loads with no error. Axis-Gui starts with no error but can not communicate.



I will download the source of machinekit and try to integrate the source from linux-cnc. But it will take some time to do so…..


You don't have to

https://github.com/machinekit/machinekit/pull/1221 is pending merge.

It builds the component, so that will be in the packages once merged and you will be able to update and test
before too long.

schoo...@btinternet.com

unread,
Jun 20, 2017, 10:47:26 AM6/20/17
to machi...@googlegroups.com

On 20/06/17 07:03, schoo...@btinternet.com wrote:
./hy_vfd.bin: symbol lookup error: ./hy_vfd.bin: undefined symbol: hal_malloc

Looks like it is not linked properly.


Now download again standalone version from cnczone.org. Compile without errors, start new bin exact same way like old bin. Loads with no error. Axis-Gui starts with no error but can not communicate.



I will download the source of machinekit and try to integrate the source from linux-cnc. But it will take some time to do so…..


You don't have to

https://github.com/machinekit/machinekit/pull/1221 is pending merge.

It builds the component, so that will be in the packages once merged and you will be able to update and test
before too long.

The component is now in the repo at https://github.com/machinekit/machinekit/tree/master/src/hal/user_comps/huanyang-vfd

It builds and when I commented out the check for a serial connection (because I don't have the hardware), loading it created the component and all its pins.

user@INTEL-i7:/usr/src/machinekit/src$ halcmd loadusr hy_vfd
<commandline>:0: Program 'hy_vfd' started
user@INTEL-i7:/usr/src/machinekit/src$ halcmd show all
HAL Components:
    ID  Type Flags Inst Name                                      PID   State
    66  rHAL   i      0 hal_lib                                   0     ready, u1:0 u2:0
    78  uHAL   i      0 hal_lib17850                              17850 ready, u1:0 u2:0
   117  uHAL   i      0 hal_lib17852                              17852 ready, u1:0 u2:0
   119  User          0 halcmd17852                               17852 ready, u1:0 u2:0
    80  User          0 hy_vfd                                    17850 ready, u1:0 u2:0

Instances:
 Inst  Comp  Size  Name                                              Owner

Component Pins:
  Comp   Inst Type  Dir         Value  Name                                            Epsilon Flags  linked to:
    80        float OUT             0  hy_vfd.ACV                                  0.000010    --l-
    80        float OUT             0  hy_vfd.CNST                                 0.000010    --l-
    80        bit   OUT         FALSE  hy_vfd.CNST-bracking                            --l-
    80        bit   OUT         FALSE  hy_vfd.CNST-command-rf                          --l-
    80        bit   OUT         FALSE  hy_vfd.CNST-jog                                 --l-
    80        bit   OUT         FALSE  hy_vfd.CNST-jogging                             --l-
    80        bit   OUT         FALSE  hy_vfd.CNST-run                                 --l-
    80        bit   OUT         FALSE  hy_vfd.CNST-running                             --l-
    80        bit   OUT         FALSE  hy_vfd.CNST-running-rf                          --l-
    80        bit   OUT         FALSE  hy_vfd.CNST-track-start                         --l-
    80        float OUT             0  hy_vfd.CNTR                                 0.000010    --l-
    80        float OUT             0  hy_vfd.Cont                                 0.000010    --l-
    80        float OUT             0  hy_vfd.DCV                                  0.000010    --l-
    80        float OUT             0  hy_vfd.OutA                                 0.000010    --l-
    80        float OUT             0  hy_vfd.OutF                                 0.000010    --l-
    80        float OUT             0  hy_vfd.Rott                                 0.000010    --l-
    80        float OUT             0  hy_vfd.SetF                                 0.000010    --l-
    80        float OUT             0  hy_vfd.Tmp                                  0.000010    --l-
    80        bit   IN          FALSE  hy_vfd.enable                                   --l-
    80        float OUT             0  hy_vfd.freq-lower-limit                     0.000010    --l-
    80        float OUT             0  hy_vfd.frequency-command                    0.000010    --l-
    80        bit   OUT         FALSE  hy_vfd.hycomm-ok                                --l-
    80        float OUT             0  hy_vfd.max-freq                             0.000010    --l-
    80        float OUT             0  hy_vfd.rated-motor-current                  0.000010    --l-
    80        float OUT             0  hy_vfd.rated-motor-rev                      0.000010    --l-
    80        float OUT             0  hy_vfd.rated-motor-voltage                  0.000010    --l-
    80        float IN              0  hy_vfd.speed-command                        0.000010    --l-
    80        bit   OUT         FALSE  hy_vfd.spindle-at-speed                         --l-
    80        float IN           0.02  hy_vfd.spindle-at-speed-tolerance           0.000010    --l-
    80        bit   IN          FALSE  hy_vfd.spindle-forward                          --l-
    80        bit   IN          FALSE  hy_vfd.spindle-on                               --l-
    80        bit   IN          FALSE  hy_vfd.spindle-reverse                          --l-
    80        float OUT             0  hy_vfd.spindle-speed-fb                     0.000010    --l-

Signals:
Type          Value  flags Name                   linked to:

Parameters:
 Comp    Inst Type   Dir         Value  Name
    80         s32   RW              0  hy_vfd.error-count
    80         float RW              0  hy_vfd.retval

However there is a problem with package builds at present, so the new package containing it is not yet available.

A RIP build will work fine however.

I will advise when new packages are available, don't know what the problem is at present.

regards

OttoMeister

unread,
Jun 20, 2017, 3:42:38 PM6/20/17
to Machinekit

Ok, thx a lot, this happening sooner than i thought.

So I made a “git clone https://github.com/machinekit/machinekit.git” but had a lot off problems with dependencies. Looks like a recent machinekit will not compiel on old Image. So I wait just a little bit and will then test it via “apt-get install machinekit”



So back to my old question:

schoo...@btinternet.com

unread,
Jun 21, 2017, 12:14:30 PM6/21/17
to machi...@googlegroups.com

On 20/06/17 20:42, OttoMeister wrote:

Ok, thx a lot, this happening sooner than i thought.

So I made a “git clone https://github.com/machinekit/machinekit.git” but had a lot off problems with dependencies. Looks like a recent machinekit will not compiel on old Image. So I wait just a little bit and will then test it via “apt-get install machinekit”


There is still a problem with automatic updates to the repo, but I have manually added the packages containing this and other recent code

You are looking for machinekit-<kernel>_0.1.1497941186-1mk.travis.master.gitdf9c7823~1<distro>_<arch>.deb




So back to my old question:
 
- Has anyone running an Huanyang VFD over Modbus with an actual version of machinkit?
- How about VFD over Modbus from different manufacturer?

--

OttoMeister

unread,
Jun 21, 2017, 4:50:47 PM6/21/17
to Machinekit

So I installed a new image -> bone-debian-8.7-machinekit-armhf-2017-02-12-4gb.img.xz
Made update and upgrade -> machinekit-<kernel>_0.1.1497941186 was installed!
Problem with new setting from github config-flies so used my old - and it works !!!!!!!!!!!
My working setup files will come later after more testing.....

schoo...@btinternet.com

unread,
Jun 22, 2017, 2:09:47 AM6/22/17
to machi...@googlegroups.com



On 21/06/2017 21:50, OttoMeister wrote:

So I installed a new image -> bone-debian-8.7-machinekit-armhf-2017-02-12-4gb.img.xz
Made update and upgrade -> machinekit-<kernel>_0.1.1497941186 was installed!
Problem with new setting from github config-flies so used my old - and it works !!!!!!!!!!!

Great.  Thanks for reporting back quickly.

If you find the configs can be improved, or even just have a full working set for a BBB, send a link
to them and I will look at incuding them as examples.

Don't suppose too many (or any) people are using this currently.

My working setup files will come later after more testing.....

--

OttoMeister

unread,
Jun 22, 2017, 12:40:57 PM6/22/17
to Machinekit
Here are my settings, I don not think the config delivered with the hy_vfd is good for something. Anyway thank you very much. Hope that others with Huanyang can benefit from this as well.
hy_vfd.7z

schoo...@btinternet.com

unread,
Jun 22, 2017, 2:38:47 PM6/22/17
to machi...@googlegroups.com

On 22/06/17 17:40, OttoMeister wrote:
Here are my settings, I don not think the config delivered with the hy_vfd is good for something. Anyway thank you very much. Hope that others with Huanyang can benefit from this as well.
Thanks, looks like a sim config?  Which will be useful

I'll look at it properly tomorrow
Reply all
Reply to author
Forward
0 new messages