I modified a TAIG lathe by adding two stepper motors. My original plan was to use it to learn how to run a cnc system. Initially I used Mach 3 with a parallel port computer. But it blew up and I have never been able to get Mach 3 to work on a laptop.
Recently I purchased some zk smc-01 stepper controller switches that have a number of built in functions. They work well. It is not CNC but better than winding the cutter by hand.
I have downloaded grbl and G code sender and was planning to have a go at that at some stage using arduino which is probably a better option for a simple old bloke like me.
Then I found a site called OneGeekGuy who, as well as providing a very good explanation of the functions of the switch posted a video showing how to use an arduino with the switch. It looks like a very good option.
Because I am not a programmer I am simply copying his code. I compile as I go and it was going swimmingly until suddently it did not like the following line of code which is a character by character copy of his code. I have asked him about it but don't know if he responds to questions.
//Motor enable forward
Motor_Enable_Disable(FORWARD);
Error message is Compilation error exit status 1.
Any suggestions please?
Is anybody else using these switches with arduino that could help me out with the intial software. The idea is to add extra functions as I go.
His program includes the ModbusMaster.h which I added to my library
If you are typing in code piecemeal and compiling, I see that the function Motor_Enable_Disable() is defined after it is used, that would cause a compilation error, if you have not typed in that function yet. I would suggest copying the whole sketch from gitlab, or if you prefer to type, make sure you have typed in all the code that is referred to.
Hi Bob
Thank you so much for that information and yes that is the code and the site. He said he had posted the code but for the life of me I couldn't not find it so I was copying it from his video. I had certainly not understood that compiling as I go is counter productive. Thanks for telling me that.
I have actually just completed a project that took me more than two years to make. My daughter is producing a video because it is an unusual contraptionI and I will probably distribute it to a few friends who are likely to be interested. In normal circumstances I would have taken it to my woodies club for show and tell but it is too big and anyway I don't drive further than the local shops anymore.
I did want to get the TAIG project done and dusted because at 87 I am running out of time. Age really does weary!
I have given up trying to get Mach 3 to work and these switches are a practical alternative solution to get the steppers functional. I was also thinking of adding a small mill head with a third stepper.
I am still trying to get my head around UGS but the switches do take the pressure off. I am unlikely to get too serious about CNC at this stage. My eyesight is good but has its challenges so I do what I can and leave it at that.
I was actually thinking of posting the video on this site, but I have no wish to break the rules and after being reprimanded I figure that may not be such a good idea.
Again thank you for taking the time, I am very grateful for your help and the help this site has given me from time to time to sort out my very simple arduino problems. I have used several arduino boards in the project which I have called W & B -- Why and Because.
I now have the program uploaded and ready to go and I have finally worked out where you got the link that you sent me from. I am hoping to be able to use his program as a baseline that I can make small adjustments to for experiments with my Taig Lathe that is now set up for CNC.
I learned a lot from the process and having his program to copy was an excellent support. I did type it up for practice and when my typed version wouldn't compile I was able to compare it with his original code that, as you said, did compile. It turns out I had an extra curly bracket!
So thanks for bothering, it made a huge difference.