584,866 active members*
5,228 visitors online*
Register for free
Login
Results 1 to 13 of 13
  1. #1
    Join Date
    Dec 2006
    Posts
    10

    xhc for KMotionCNC

    Tom,

    After a migration from Mach3 to KMotionCNC, our cnc project had an xhc HB04 pendant left over. It seemed such a shame to waste and our client was quite partial to it so we looked into integrating it with the system. Some research into the device was able to yield all the info necessary to create a console application that runs separately of KMotionCNC.

    The application now works and we are able to use the pendant to control the machine, albeit it a bit cumbersome in implementation because it runs separately. Some clever windows tricks, a few lines of c and some persist made it seem to have almost transparent control in the end. We were able to connect almost all parameters to the pendant, and it seems to work better than when it did during its days of operation in Mach3, at least to the opinion of our client.

    At this point we considered integrating it into KMotionCNC, an implementation that could potentially include the HB03 as well (the classes are almost identical). This would become an issue for every new release of the software as it would have to be added again.

    We are not really sure if you have plans in future releases for pendant control in KMotionCNC, or plan for an SVN like github, however we would like to start a conversation with you to see if you would be willing to collaborate with the integration of these controls. We feel that this may benefit the application, however we are not sure if you share the same feelings.

    -Frate

  2. #2
    Join Date
    Dec 2006
    Posts
    10

    Re: xhc for KMotionCNC

    Attached is the xhc HB04 pendant control source code to work with KMotionCNC 4.33k, with a crude manual and the executable. We truly hope this helps someone out there. We know it helped us.

    It is very crude, but it should work. The copy you see before you is a distilled version. Bugs are to be expected.


    We take no responsibility for this. Use at your own risk. You have been warned.


    Tom, if you wish to pursue integrating this into KMCNC, we have some ideas and would love to help.


    For anyone else, I would be happy to answer any questions about this, however you mileage may vary.


    -Frate

  3. #3
    Join Date
    Dec 2004
    Posts
    132

    Re: xhc for KMotionCNC

    Thanks Frate!. I don't have one of these pendants, but I am tempted to get one now. At any rate, the contribution is greatly appreciated.

  4. #4
    Join Date
    May 2006
    Posts
    4043

    Re: xhc for KMotionCNC

    Hi Frate,

    Very clever approach and nice work. Even includes a manual!

    I do get an mfc120u.dll error when I try to run the Console.exe. I think that is a Microsoft MFC distributable. I also don't see a Visual Studio Project Solution. But I don't have a Pendant to try it out anyway.

    We are certainly always open for suggestions.

    Thank you.
    Regards
    TK
    http://dynomotion.com

  5. #5
    Join Date
    Dec 2006
    Posts
    10

    Re: xhc for KMotionCNC

    This should fix the dll issue.

    I hope to be able to post the vs solution in a few days.

    Tom, I have spoken to our client, and it turns out he is willing to loan you his pendant anytime after the beginning of May. If you are interested feel free to send me an email or PM.

    Our suggestion is to provide pendant control for KMCNC. Of course, this is easier said than done, given the complexity of these devices.

    A better suggestion is to provide a plug in architecture for pendants. This way they can be independently developed and supported.

    In either case, we believe it could add value to your product.

    As for just getting this pendant running in KMCNC, the biggest concern is how much time one can have executing in the OnTimer() function. We believe it is the best entry point for servicing the pendant, but wonder about it causing adverse effects if it sat there too long for some reason. I guess we could of just tried it, but then the whole conversation about having to revisit this in the future convinced me to stick with the console.

    I did actually try it once just to see if I could get the hid and the pendant class into KMCNC, and it compiled, but for some reason it would cause pandemonium when it ran. The debugger would break without having a line to point to, and would only give me an assembly debugger, which turned into a large screen full of question marks that went on forever. At that point I suspected the hid class as the culprit, but never pursued it further.

    Below is a link of the pendant in operation using emc as an example of operation.

    https://www.youtube.com/watch?v=HiCpUB6TpdA

  6. #6
    Join Date
    Dec 2006
    Posts
    10

    Re: xhc for KMotionCNC

    Attached is the complete solution made with vs 2013.

    I stripped the db files so that it wouldn't be a huge upload. If you rebuild it, it should all work. Also, I was forced to use 2013 due to the software requiring a few threads and mutexes in order to work correctly. I looked all over for a this sort of support in vs2008 but to no avail.

    I suppose it could be ported to 2008 given the implementation was reworked, we just couldn't spend that much time on it. Also, we believe we would lose too much functionality; such as the console looking for KMCNC running. I'm not too sure if such features are in vs2008.

    The software uses a few threads to handle i/os on the pendant, KFLOP connection and of course a main thread for the actual actions.

    Crude, I know.

    If implemented in KMCNC, the approach would be something completely different. You should be able to handle it all in the Timer thread, because KMCNC handles the the KFLOP connection. At this point, the i/os would be buffered by windows, and you wouldn't need to use the queue.

    -Frate

  7. #7
    Join Date
    Jun 2013
    Posts
    1041

    Re: xhc for KMotionCNC

    This looks like a great setup if you can get all the kinks worked out. I have wanted to add a pendant for some time but haven't been in a position to do all the wiring. This would be a perfect solution since I'm assuming no wiring is needed. Thanks so much for making this public. It looks like it was a lot of work so it is a major contribution. I wish I could help but I am not qualified to even begin making suggestions. I guess it's about time I sign up for some programming courses.

    Ben

  8. #8
    Join Date
    Dec 2006
    Posts
    10

    Re: xhc for KMotionCNC

    Quote Originally Posted by bhurts View Post
    This looks like a great setup if you can get all the kinks worked out. I have wanted to add a pendant for some time but haven't been in a position to do all the wiring. This would be a perfect solution since I'm assuming no wiring is needed. Thanks so much for making this public. It looks like it was a lot of work so it is a major contribution. I wish I could help but I am not qualified to even begin making suggestions. I guess it's about time I sign up for some programming courses.

    Ben

    Ben,

    You are right, no wiring required. The pendant uses a usb dongle plugged into the host PC and communicates wirelessly. The trick is to run the software at the same time as you run KMCNC.

    As with most usb pendants, wireless or not, it is not fail safe by any means, however if used wisely, it can be quite comfortable on a large machine. I personally prefer a fail safe one, and the key to that is wiring it to the KFLOP.

    Also, its never a bad idea to sign up for courses (or my personal favorite, video tutorials on my tv). There is always something to learn.


    -Frate

  9. #9
    Join Date
    Feb 2010
    Posts
    371

    Re: xhc for KMotionCNC

    I have been working on my own version of KMotionCNC for quite some time now and have it running with the Russion ShuttleRu STM pendant.


    I did exactly what you suggested, running my own service routine call within the OnTimer event. It looks like my pendant works very simular to yours. I get serial a data packet whenever any hardware event occurs with the pendant which is decoded, and then appropriate action is taken. I don't use my own instance of the exported Kmotion class, rather use the pointer from the KMotionCNC software, as well as pointers to the step buttons and makes calls to simulate button presses for the step action. I plan on posting my source code eventually. There are still some odd things to work out first. Being short on time, I've just learned to live with them for now.


  10. #10
    Join Date
    May 2006
    Posts
    107

    Re: xhc for KMotionCNC

    Quote Originally Posted by AiR_GuNNeR View Post
    I have been working on my own version of KMotionCNC [/IMG]
    Hi Eric,

    Is your version of KMotionCNC free? If yes, where can it be downloaded?

  11. #11
    Join Date
    Nov 2005
    Posts
    34

    Re: xhc for KMotionCNC

    I know this is an old thread, but I've just downloaded the zip file in an effort to utilize the XHC Pendant. I seem to be missing the PendantControl.exe file. I've looked in the other zip files shown in other posts in this thread, with no luck.

    Anybody know it this has ever worked and if it might work with today's KMotionCNC version? Do I need to compile the PendantControl.exe for myself?

    Thanks in advance.
    Gary

  12. #12
    Join Date
    Nov 2005
    Posts
    34

    Re: xhc for KMotionCNC

    I know this is an old thread, but I've just downloaded the zip file in an effort to utilize the XHC Pendant. I seem to be missing the PendantControl.exe file. I've looked in the other zip files shown in other posts in this thread, with no luck.

    Anybody know it this has ever worked and if it might work with today's KMotionCNC version? Do I need to compile the PendantControl.exe for myself?

    Thanks in advance.
    Gary

  13. #13
    Join Date
    May 2006
    Posts
    4043

    Re: xhc for KMotionCNC

    Hi Gary,

    Yes I believe he only provided the source code. You could use the free version of Visual Studio 2015 Community to compile it. I just tried and it compiled after upgrading the project and fixing some missing references to KMotion Header Files.

    Although I don't have a pendent and don't know exactly what it is supposed to do. It ran but printed 1, 2, 3, 4 ,5 then quit.

    Regards
    TK
    http://dynomotion.com

Similar Threads

  1. KmotionCNC abort
    By randyrhine in forum Dynomotion/Kflop/Kanalog
    Replies: 7
    Last Post: 01-25-2015, 09:50 PM
  2. KmotionCNC startup
    By Dave3891 in forum Dynomotion/Kflop/Kanalog
    Replies: 1
    Last Post: 03-20-2014, 10:52 PM
  3. KmotionCNC 430 Problem
    By Fish4Fun in forum Dynomotion/Kflop/Kanalog
    Replies: 5
    Last Post: 06-26-2013, 10:43 PM
  4. Is anyone using KmotionCNC instead of Mach3?
    By John Coloccia in forum Dynomotion/Kflop/Kanalog
    Replies: 5
    Last Post: 02-22-2013, 08:11 PM
  5. KMotionCNC
    By alexandr_st in forum Dynomotion/Kflop/Kanalog
    Replies: 8
    Last Post: 01-17-2013, 07:11 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •