Wow this is not my first time typing out this post.
This version will be slightly condensed so here we go again.
I converting my G0484 milling machine to 3 axis CNC.
I'm using Clearpath servos for the 3 axii x, y, z. Motor and user manuel found here
I want to use Arduino Mega as the step and direction controller. The servos will be powered by the Clearpath power supplies.
The servos require 4 I\O pins each. An InputA pin, an InputB pin, a HLFB pin (high level feed back) and all three servos can share the same Enable pin. As far as I know the servos can be configured to a Step and Direction mode.
To my understanding, I need to flash the Arduino Mega with grbl-Mega_v1.1f.20170802.hex and download the appropriate GRBL library files and install to the IDE library folder.
If I understand correctly, once the Mega has been flashed with the grbl-Mega_v1.1f.20170802.hex file I'll no longer be able to upload sketches it, (or maybe I wont need to?).
How do I allocate I\O pin? Is this something that need to be done in the .C and .H files?
How does GRBL even work with these servos? I've seen people do it but can't find the how to.
I'm hoping I can just connect the the 4 I\O pins from the Clearpath servos directly to the Mega without the use of a shield?
Assuming the Arduino Mega flashed with grbl-Mega_v1.1f.20170802.hex is connected to my windows 8 PC via USB, How do I send the Gcode program from Fusion 360 CAM to the Mega?
I'm sure this will be the tip of the iceberg but that's all I can think of for now. Any info or advice anyone could share with me would be greatly appreciated.
J
Following the link You attached it looks like powerful motors providing 800 steps per revolution and that ought to give You a very good resolution in the X, Y and Z directions.
What info does the HFLB signal provide? To me it looks like a simple little UNO could do the job of handling GRBL
Downloading to UNOs can be done some 10 000 times without any other work. If the Mega is different, other members have to tell.
Look for topics about "Steppers". That will be helpful. Some of Your questions, from Fusion360 down to Your controller will have the same answer regardles of the controller You use.
Start at the lowest level, making one motor do as You want. For purposes like that I use a Estlcam to move my stepper motor controlled Micro CNC or Arduino IDE sketches. Just as a beginning….
I liked the idea of using the mega because of the increased buffer size and the increased number of moves its able to look ahead. I think it would be usefull when doing 3d profiling. But in saying that, I have a few Uno's laying around to cut my teeth on.
I think the hlfb can do many functions. One being hard stops. It monitors current levels and you can set a current limit or have the servo current max out when the table reaches the end of its travel. I havent read to much into that bit yet.
Hlfb is some serial communication wire then? I don't how to use that feature from a Grbl environment but maybe some other member does.
End stop sensors are normally connected to the controller board I would say and handled within the Grbl system.
Railroader:
Hlfb is some serial communication wire then? I don't how to use that feature from a Grbl environment but maybe some other member does.
End stop sensors are normally connected to the controller board I would say and handled within the Grbl system.
Yes, I hadn't thought of that. Thank you for pointing that out. How do you set pin numbers and functions in GRBL? Is it in the .h and .c library files?
Railroader:
Following the link You attached it looks like powerful motors providing 800 steps per revolution and that ought to give You a very good resolution in the X, Y and Z directions.
I tried to do so math around this and if it's correct I should be able to have an accuracy of something like 0.00625mm and in theory have a max travel speed of 7 meters per minute with a direct drive. If I decide to run pulleys at 1:2 it could double the resolution and torque and half the travel speed. But in saying that my math is not that great.
I have not cracked the secrets of Grbl yet so I can't tell. One way is to find out on which pins Grbl wants to find X, Y and Z -step and dir and connect to those pins. There is also G-code….. I have not got that faar yet….
Your calcs are most likely good.
Railroader:
I have not cracked the secrets of Grbl yet so I can't tell. One way is to find out on which pins Grbl wants to find X, Y and Z -step and dir and connect to those pins. There is also G-code….. I have not got that faar yet….
Your calcs are most likely good.
I think you all need to study the GRBL configuration setup.
Paul
Thanks for that Paul. I did find the default pins in the cpu_map.h but at a glance it looks like you can set it all up from the config.h file. I'll have a better read later on.
Well after a couple days of intensive study, I have managed to get motion.
I uploaded GRBL to my DFRobot mega just like any other sketch. So my uncertainty about flashing firmware to it was all for nothing.
I downloaded and am using Universal Gcode Sender to make the commands. And I used This to make an initial setup from the Arduino IDE serial monitor.
It's all been a big learning curve but a good one.
I think I may need to invest in a commercial control board and software to take full advantage of what the clearpath servos are capable of.
Hi gyrojeremy,
I am an engineer at Teknic and came across your post.
I am not an expert in Arduino but hopefully I can clarify a few points for you.
You are correct in that all the servos can share the same Enable line and the ClearPath – SD (Step and Direction) series motors natively take in step and direction signals.
The ClearPath - SD series motors have 3 digital inputs (Enable, Input A and Input B where Input A is the direction line and Input B is the step line) and a digital output (HLFB – High Level Feedback). Teknic’s ClearPath manual provides additional information on this topic.
In regard to wiring up the ClearPath I/O to Arduino, you do not need to use a shield and can wire the signals directly as the optically-isolated signals on the ClearPath motor can be driven directly by the Arduino’s 5Vdc outputs.
I am not personally familiar with GRBL but we have had customers successfully use Arduino/GRBL with ClearPath in the past so what you are trying to do is definitely feasible.
I hope this helps and best of luck on your machine conversion.
Mark D.
Hey Mark,
Thanks for your input.
I haven't studied up on the HLFB yet nor am I sure if I can even use it with GRBL. Nothing has jumped out at me while learning how to put it all together.
I used the default I\O pins according to the GRBL cpu_map.h setup (Step, Dir, Enable) and used a maker shield I had lying around to put them all in line for easy connections, but yes you could easily do it without any shield.
I still have a lot of learning to do so any feedback is valued.
Well I only have one motor at this point. The others are on the way. It's set up as X axis motor.
But yes I have movement. Took me some head scratching to work out how the moves work.
This is a guess but I'm assuming GRBL zeros the axii upon startup as I don't have any homing enabled. So in saying that, it would only move one way before it could then return back to zero. This confused me at first because it does move a little into the negative but not the programed amount.
Firstly in UGS (Universal Gcode Sender), when I use the jog function I can only get it to jog at a max speed of 500mm\s. If I try to push it faster the servo starts to make a noise like it's fighting itself. I'm assuming this has something to do with UGS controlling the step and dir itself and the speed at which UGS can issue commands?
If I use G0 command (something like G0X750) to move it, I can get smooth, faster speeds, however I think the actual speed is a lot slower than the max mm/min speed set in GRBL, so I must have some settings wrong somewhere.
Hopefully I'll have more time this afternoon to play around with it.
Great! One axis is alive. The other two will bepretty much just copying.
Look for maximum step rate for the motor. Jogging might behave different from nirmal cutting. I see that in Estlcam..... Just a feeling.
Start from zero..... The Mega probably resets values when starting. How to preserve basic settings and initialisation I can't tell. End switches and maybe also a home indication is udeful I think. None of them is yet installed on my micromill.... Mishaps are not faar away when jogging...
Whats your set up on your micro mill ?
I've just been playing and I can't make rhyme or reason from the moves. If I enter say g0x100, it will move 100mm. If I then enter g0x100 again it will move in the opposite direction or not at all. When it moves the direction it's meant to move the distance is normally correct.
On a few occasions I entered g0x-200 and it will move over 1000mm???
![20181201_143918[1].jpg](https://europe1.discourse-cdn.com/arduino/original/3X/7/6/76122a69ff7fa7e01e87a738994f7deae7f3c673.jpg)
That sounds strange. Any maximum distance violated? Shouldn't do luke that anyway.
I have no real setup. In Estlcam I have set up steps per mm, speedrate etc but in my Arduino IDE sketches all that is defined in the sketch. Current position is just where the tools happends to be at startup. I use Estlcam for initial positioning.
Here are the commands I'm entering in. Revolutions are not consistent in any of of the commands. But one thing is fairly consistent is that no matter what I enter in, it wants to spin CW one command and then CCW the next, then CW, then CCW and so on.
I'm lucky enough to have fusion 360 for all my tool path plotting and gcode generation. I splashed out on an ESS and BOB this morning. So I may can this and start learning how to use Mach3
![20181201_145622[1].jpg](https://europe1.discourse-cdn.com/arduino/original/3X/c/9/c9e71f411dcbc8d18e496c26ffa18e43085bd8f6.jpg)
![20181201_145548[1].jpg](https://europe1.discourse-cdn.com/arduino/original/3X/8/f/8f580e1825898150eb3c18b005625c1f9a6ba978.jpg)