Creating a new vfd driver...

08 Jan 2018 12:58 - 08 Jan 2018 13:00 #104159 by Mau
Hi all,

I have a Delta VFD-E and want to control the speed via RS485.
I want to modify the vfdb_vfd.c file to match the addresses of my Delta VFD-E.
Can anybody give me some help on the next steps compiling it or give me a good link.
The only link I found so far is this:
But I think that this does not work with the later linuxcnc versions (I use 2.7.6).
Also do I use the make command or the comp command (comp with --install for c-files)?

Thanks in advance,
Last edit: 08 Jan 2018 13:00 by Mau.
08 Jan 2018 17:46 #104171 by seb_kuzminsky
Hi Maurits!

This is the overall process for contributing to LinuxCNC:

That probably looks familiar if you've worked on open-source software before, but if you're new to this world it should give you a starting place.

Before you start adding your driver, the first step is to check out the existing LinuxCNC source code and build it using the instructions here:

(That will give you the "master" branch, which is where new development generally takes place. If all you're doing is adding a new driver and you're not changing any existing code, then you should probably do your work on the "2.7" branch instead.)

Once you can build the existing source code the next step is to add your new driver.

I don't know how different the VFD-E is from the VFD-B; if they're very similar you should consider adding support for VFD-E to the existing VFD-B driver, if they're significantly different you should consider adding a new driver specifically for the VFD-E (possibly using the VFD-B driver as a starting point).

I'm assuming you have a programmer's manual for the VFD-E available that documents the modbus registers. Comparing that to the existing VFD-B driver should give you an idea of how different they are.

I hope this helps get you started. Feel free to ask follow-on questions and we'll try to help as best we can.
08 Jan 2018 18:18 #104172 by Mau
Replied by Mau on topic Creating a new vfd driver...
Thanks for your responce,

I am looking more for someone to elaborate on this part:

Create a directory under "/home/my_home/emc2" such as "/home/my_home/emc2/my_vfd"
Copy into "my_vfd" a sample vfd.c, modbus.c, modbus.h, and Makefile
Edit my_vfd-x.c and Makefile
Run "cp my_vfd-x my_vfd.c", "make", "sudo make install"

in this link:

This is how you suppose to make a new driver, but this does not work, I think mainly because this is from an older version, but the manual does not give any info on how to do this with a newer LinuxCNC version.

08 Jan 2018 18:36 #104174 by seb_kuzminsky
That information from the wiki is out of date and no longer reliable. The wiki is unfortunately not maintained, official documentation.

If you've read the official documentation that I linked for you above, and you've decided to take the "add a new driver" option rather than the "extend the existing VFD-B driver to handle the VFD-E too", then here's what you should do:

In the directory where you checked out the linuxcnc git repo, look in src/hal/user_comps and you'll find a directory named vfdb_vfd, containing the VFD-B driver and its Submakefile. Make a copy of that directory (perhaps named vfde_vfd). Next look in src/Makefile and find where it enters looks in the vfdb_vfd directory, and add your new vfde_vfd directory next to it. Finally make the updates needed in the new vfde_vfd source code to switch it from talking to the VFD-B to talking to the VFD-E.
09 Jan 2018 08:20 - 09 Jan 2018 09:26 #104195 by Mau
Replied by Mau on topic Creating a new vfd driver...
I have tried this already, but will try it again.
Last edit: 09 Jan 2018 09:26 by Mau.
09 Jan 2018 11:45 #104197 by Mau
Replied by Mau on topic Creating a new vfd driver...
Were do I run the make command from after that...
If I run : make -f Submakefile vfde_vfd in that new vfde_vfd directory it can not find rtapi.h
And if I run it like: ~$/linux-dev/src/make -f ./hal/user_comps/vfde_vfd/Submakefile vfde_vfd it gives not found
09 Jan 2018 18:12 #104212 by seb_kuzminsky
From the src directory, run "make ../bin/vfde_vfd".
10 Jan 2018 08:25 #104229 by Mau
Replied by Mau on topic Creating a new vfd driver...
Hi Sebastian,

I don't know what I am doing wrong, I thought it would not be this hard to recompile a driver, but by now it would have been faster to use classic ladder to control my vfd, so I am gone give that a shot now.
But thanks again for your help!

Best regards,
10 Jan 2018 19:25 - 11 Jan 2018 09:51 #104250 by Mau
Replied by Mau on topic Creating a new vfd driver...
In the end I actually got the original vfdb_vfd driver working on my vfd-e, turns out the sample custom.hal files I found had entries in it that the vfd-b and vfd-e did not understand.
Basically the custom.hal samples with the lines forward and reverse do not work with the vfdb_vfd driver.
Last edit: 11 Jan 2018 09:51 by Mau.
Time to create page: 0.082 seconds
Powered by Kunena Forum