Tuesday, 7 April 2015

My CNC story (part 5)

Please read previous parts first. This is the fifth part of my CNC story. Click here to find part 4, here for part 3, here for part 2  and here for part 1. As you may have noticed, I have started to add pictures to the previously written material also, so it might be a good idea to revisit previous parts even if you have read all those already. I will continue adding new pictures, and also video, as I find the time to do it.

Selecting a USB motion controller


There are not that many USB motion controllers on the commercial market, at least not those aiming at the more serious DIY CNC builders.  The number of these is growing, but most cards are special designs which require a special CNC software, not supporting the standard and most popular CNC software (at least that’s what I think it is), the Mach3, which I plan to use with my CNC.

Another thing is the price. These cards are not very cheap, especially considering the simplicity in their functionality. Never the less, just like with my V1-F1A adapter, I understand that low volume, special design and special function ends up with high price so I perfectly understand that these cards cost more than just an ordinary USB to parallel converter.

Anyway, after some survey I ended up with a small USB motion control card which had all the functionality and input/output ports I needed, and more than that. It allows me to introduce future enhancements in case I want to expand the CNC further, like for example the possibilities of using a 4th or even 5th axis. At least that was the case in theory… reality proved to be a little different, even this time.

HyCNC-4L USB card


I went for this card also because it is not based on a DB25 printer port interface but on an open standard connection solution, allowing easy connection to any stepper controller card, enabling me to throw the old cheap 3-axis stepper controller card away, which I was never really happy with. Of course, this was just a future plan, first I needed to start up with the stepper controller I have… well, at least this was the plan when I ordered the HyCNC-4L card.




Another reason to order this card was the fact that it is on the list of USB cards supported Mach3, the CNC software I will be using when my CNC is ready. I figured that it was a good idea to buy a card which is recommended by ArtSoft, the makers of Mach3.

The card is a small, credit card sized card and is well documented by the manufacturer. It is made in Australia and was shipped out from there, so it took a long time to get it, had to wait for over 6 weeks to get it, but finally it arrived.

Connecting my new card


After inspection of the quality and scrutinizing the soldering with a magnifying glass I concluded it is nicely build and very well soldered, so I decided it was time to fire it up and see if it works as expected. I started with a laptop, before connecting to my main computer, just in case it would blow my computer to pieces… Nothing dramatic happened. After following the instructions and installing the driver and the plugin software everything seemed to be fine. Mach3 recognized the card, and after configuring Mach3 according the HyCNC-4L USB manual, I could do some fake X, Y and Z axis movements as well as to switch the three on-board relays on and off. I also checked all the outputs and inputs changing state using an oscilloscope to see that every signal acts as expected. Everything seemed to work, no smoke came out of the card or my laptop, so it seemed safe to connect it to my main computer as well. I repeated the tests with my main computer and concluded that this was a very good decision.

Some HyCNC-4L USB bugs and errors


While the card is nicely build and originally it seemed to work like described in the manual, it didn’t take long to find some errors. Actually, within the first hour after initial connection to my laptop I found some issues, one very serious one, the others just manual error.

Error 1:  Pin 5, output 1, is matched to Mach3 Port #1 pin 5, not to pin 3 as the manual states.
Error 2:  Pin 8, output 3, is matched to Mach3 Port #1 pin 3, not to pin 5 as the manual states.

Both of those are just typing errors, the manual is wrong so that is easy for me to live with. I guess it is worse for those who don’t have the knowledge to measure the signals and can’t figure out why they can’t control pin 5 and pin 3 as they want, even though they follow every step of the manual. Anyway, those two are just minor issues since those only concerns the manual, functionality is as expected after correction of the syntax error in the manual.

The more serious problem was one concerning the control of Step Enable signals. The Step Enable signals should be activated when the Mach3 is running a G-code and disabled on any kind of stop signal, especially eStop and hardware limit switches. The options for these signals (one signal for each of the four axis) supposed to be software control by Mach3 (option 1) or controlled by Offline button via a Mach3 button (option 2). The signals could not be controlled by Mach3 G-codes (software) at all. The only way to control these signals was if the card was configured to control these signals as option 2, “Offline controls Step Enable”. This was not a very good solution, in fact it can even be dangerous, because every time the eStop (emergency stop) or any of the limit switches gets pressed the step motors should be disabled as well to release tension, not just kept in holding power. The only way to control Step Enable was by using three (or four if configured for axis use) other other outputs, but that means that some functionality is lost and also wasted some outputs. This was really a workaround, not a solution, and it was clear that the HyCNC-4L plugin had some bugs in it.

Excellent support from HyTechWorks


I contacted HyTechWorks support, and to my surprise, just three days later I received an apology and a new plugin which I was asked to test. The new plugin worked as expected, the bug seems to be fixed and Step Enable can now be controlled as needed and I was very satisfied with the support.

Currently the official plugin version is still 3.3.6, I don't know why he is not releasing my version 3.3.7, if any of you is interested in the fixed version ask HyTechWorks, or just send me a message and I mail the Version 3.3.7 dll file to you. Of course, since I have nothing to do with HyTechWorks, I can not guarantee anything and you use this plugin at your own risk. If you want support from HyTechWorks you have to contact them directly without my involvement.

Unfortunately, my joy didn't last long. I discovered some other, even more serious problems. I explained the problems to them and after that heard nothing more from them until today. They confirmed that G31 (read below about the details) is not supported and they also asked me to help out fixing the issues. I promised to help as much as I can. These guys deserve help since the product itself is very good and if everything would work well it would be great potential for the community, so I will help if I can.

Anyway, this error, which is a combination of two errors, is so serious that I would advise everyone against buying this card or any other one of HyTechWork products until this bug is fixed. This problem makes the card basically useless for serious works and there is no real workaround unless you are a programmer and have time to develop your own solution, and also you are a CNC expert.

I am a former programmer, but not a CNC expert. I managed to develop a solution based on my programming skills, but my solution is perhaps not the most optimal because I am not a CNC expert. Never the less, for now, my solution works for me, I will not give up just yet, but I am definitely not happy with the support from HyTechWorks.

The bug which renders the HyCNC-4L USB basically useless


The HyCNC-4L USB plugin has a nice function and the card has an opto isolated input called Probe. This can be used to automatically measure tool length or set the work piece zero point. This is necessary to do before use and after every tool change to make sure that the mill is not milling/drilling into the tool table or the fixture. Mach3 must know where the work piece begins, where it should start milling and drilling, how to lower and raise the Z axis to control the depth of milling/drilling. This can be done manually also but it takes time and is difficult to make it consistently as accurate as an automatic process would offer. Also, if you often need to change tools or work pieces then a manual process is very tiring, so some automation is definitely necessary.

There is a G-code for probing, G31, but the HyCNC-4L USB has a build in function, so that seems nice. Unfortunately, the built in function is not working as it supposed to, both of the two different type of probing results in serious errors, in type one at the end, the offset is wrong and in type two, the probe is lowered at full speed, smashing the probe into the tool table, and if this is done with a real work piece and real mill, it may even destroy the machine.

After a week of trying everything, including contacting HyTechWorks but not receiving any response, I gave up and decided to write my own G code using G31 instruction and everything around. This seems a fairly simple task for a programmer, so it sounded like a piece of cake, just some simple programming and more time is needed. That was what I thought…

GGGGGGG….  #¤%&!½§


For those of you who are not very familiar with G codes, G31 is a Mach3 function which, if used on the Z axis, lowers the Z axis until the Probe (sometimes called Digitize) signal is activated. When that happens the Z axis is stopped immediately and a proper zero offset is set. G31 can be used for any other axis as well, for example to find the edges of a work piece, the center point of a hole, or to digitize an object to create a 3-D copy of any object.

Well, once again, and this time definitely making me extremely upset, I concluded that the HyCNC-4L is not a product to recommend to anyone, and now finally I definitely regret buying it. I just couldn’t believe myself first, and it took quite some time and several different approaches to conclude that the plugin is not supporting G31 at all. Not only that, but several necessary Mach3 macro functions are not supported, like for example IsSuchSignal(SignalID As Integer) and IsMoving(), both are necessary for testing and identifying probe signal. Without these two and the G31 there is no way of making an efficient probe.

I think that until the problems are fixed, the card should be removed from the Mach3 site, which wrongly claims that the HyCNC-4L is Mach3 compatible. If it was not on that site I wouldn’t have bought this card the first place, but because it was listed there, I assumed it would work well. I consider contacting ArtSoft, the maker of Mach3, and ask them to remove HyCNC-4L from their list, since “Working with MACH3 PC based CNC software, including latest version 3.043.066.” is an incorrect statement.

Workaround for the probing issue


In the end, and after a week of programming, I managed to create a Visual Basic program which can be used as a macro in Mach3. This macro enables me to automatically set the necessary offsets for all the axes. It is a very long macro, perhaps not the most optimal solution because I am not a Mach3 expert, but it works. I have tested during many hours, so I am pretty confident about it, but when I have time over I will improve it further. Never the less, for now I will continue with my CNC building and initially I will use it as it is.

If any of you are interested in it, just drop me a mail and I’ll send a copy of this VB macro to you free of charge so you don’t have to go through the same ordeal as I did to get it working. I still hope that HyTechWorks will admit to this problem and fix it, but I can’t give up because of them, so I will continue the project.

In the meantime, here is a picture of the first work I did with my CNC. Not yet a milled piece, I attached a pen to simulate milling, but I am really happy with the results, the written text is definitely nice, circles are circles, not ovals, straight lines are straight lines. I have of course used also measuring tools to measure accuracy and knew that this is going to work, so I was not that surprised over the results, but it was anyway very satisfying to finally see X, Y and Z axes moving exactly as expected when I wrote this text on the CD.




(...to be continued...)

No comments:

Post a Comment