Machinekit Confusion

62 views
Skip to first unread message

ooda...@gmail.com

unread,
Mar 5, 2024, 8:57:41 AMMar 5
to Machinekit
I've installed  bone-debian-8.7-machinekit-armhf-2017-02-12-4gb.img.xz  on my old beaglebone black and have my machine up and running again.  I have compiled the wj200_vfd.c file from the .comp file in the main LinuxCNC branch and have that working with an RS485 to USB serial converter.  So far I'm pretty happy with it.

My question is I tried to get the newer machinekit-hal and emcapplication working but, I'm not sure from the website if that is even the latest as there is a github repository and some sort of cloud9 or something repository.  It looks like only a certain kernel works with the emcapplication as well.  I like machinekit and it seems to be a nice project but, not very actively developed so I'm wondering is that because the main LinuxCNC branch now has incorporated what was in LinuxCNC?  I'm asking because I'm looking for a long term solution to build a few machines and I'm wondering if going the Raspberry Pi 5 route and running LinuxCNC directly would be a better option since it has the capability and I believe there is a real time kernel for that as well.  

I'd like to stay with machinekit but, it does seem very similar to LinuxCNC.  Does anyone on here know the real differences between the current LinuxCNC 2.9 version and the older pre-built image.  Any information would be greatly appreciated.  

I should probably put this in a different post but, hopefully I can give back a little and this is for anyone running the image above, can't say if it would work with any other images or not but, I've only tested on the one above.  

I compiled the wj200 driver from that image.  If you copy wj200_vfd to the /usr/bin director and chmod it to be executable and then copy the wj200_vfd.so file to the /usr/lib/linuxcnc/xenomai/ directory(not sure if this is entirely necessary as it may just need the /usr/bin file) .

I used a Waveshare USB to RS485 adapter and it was just recognized and I didn't have to do anything with it like compile drivers since I believe they are part of the kernel.  I had problems with improper grounding from the USB to RS485 adapter at first and whenever the spindle would run it would cause a voltage spike on the RS485 adapter which would cause it to reset.  This would cause the vfd to go into error as I have it programmed to trip when it loses RS485 communication.  Problem is probably timing related as Linux doesn't release the ttyUSB0 fast enough and then for some reason when testing with halrun it would hold on to the ttyUSB1 even when using usbreset(included compiled version for the version of image I listed above)  I solved this by using only the ground connection from the USB adapter and connecting that to my case(earth ground).  I saw all kinds of messages on the internet about using a shielded cable and connecting the shielded part of the cable to the USB adapters ground, etc.. and none of those worked.  They forgot to mention the most important part which is that it needs to go to earth ground.  So after doing that it solved my adapter disconnects.   I have included all of the files I used or compiled if anyone wants to use them.  I'm posting here by the off chance my machine dies hopefully this will still be up and I can just download the files and be off to the races again with a new BBB if necessary.  The .c and .asciidoc files were pulled from the .comp file.  Then I compiled the wj200_vfd files and put them in the correct directory.  Anyway, hopefully this will be useful to someone who wants to use their Hitachi WJ200 VFD over RS485.  Sorry, you are on your own for creating a .hal file as I have just started to create mine but, you can definitely figure it out by using the asciidoc file below.




wj200_vfd.comp
wj200_vfd.asciidoc
wj200_vfd
wj200_vfd.so
usbreset
wj200_vfd.c
Reply all
Reply to author
Forward
0 new messages