I am a relatively new Arduino enthusiast, so I'd appreciate any guidance the community can offer. I recently embarked on a 3D printer project and purchased an Arduino UNO to JUST regulate the dual extruders that I have (NEMA 17 2-pole stepper motors with thermistor, heating element, and 2 fans a piece) for the 3D printer.
I also purchased a dual motor shield for the UNO (http://www.robotshop.com/en/dual-stepper-motor-driver-shield-arduino.html#Useful Links). Also, I have a separate CNC contoller that runs the 3 linear axes (ball screw type) using G code (ProNC is the software), so I don't need the Arduino to worry about motion, but I would like the UNO to be able to read or know the extruder's coordinates with regards to a reference point if possible.
My initial question is can I use the Arduino UNO along with a dual motor shield to control the 2 extruders that I currently have? Now, I've been reading forums where people say you need the MEGA to control the dual extruders, but I figured since I don't need the UNO to control 3 other motors for linear motion that the UNO would suffice. Also, the two extruder motors have 4 wires each and my motor shield has 2 4-wire terminals that can accommodate both. I'm just concerned about the fans (2 wires each), thermistors (2 wires each), and heating elements (2 wires each). Basically, do I need an expansion or a new Arduino?
And secondly, how might I remotely interface my CNC controller with the UNO? The CNC controller has remote outputs that can be controlled with M code. Thanks!
I don't know if an Uno has enough I/O connections to control all your bits and pieces. It should be well able to do the computations. A Mega has more I/O connections.
I haven't the faintest idea how you might interface your CNC controller with the Uno.
Your stepper drivers are reportedly capable of 750 mA but that may be assuming heat sinks and a fan. How much current do your extruder steppers need? What pins do the two stepper controllers use?
You will probably need one analog input pin per thermistor.
You will need one digital output pin and a MOSFET for each of the two heaters. What voltage are the heaters designed for? Is that the same voltage you need for your steppers? Do you want to use PWM control for steadier temperature control or bang-bang control. You have 6 PWM pins on an UNO and the stepper drivers may be using some of them.
If you want to control the fans you will need a digital output pin and a small MOSFET or transistor for each.
Sounds like you need about 12 digital pins and 2 analog input pins. That is a bit tight on the UNO but not impossible. Adding communication with the CNC controller. I don't expect the M codes that the CNC controller uses for output can be made to constantly report the position of the head.
You can't get accurate synchronisation of the extruder acceleration and the XY acceleration with two different microcontrollers controlling different motors. You absolutely have to have all 4 main axes of control on the one controller.
The way G-code works, it synchronises movements in all axes so that the filament extrusion exactly matches the movement of the head. You can't have a controller reading out G-codes, then packaging up some of those movements to send to another controller. And no, you can't put one controller in between your first two and expect the execution of the codes by the two controllers to be synchronised either.
The print head temperatures also need to be synchronised with the XY moves, although this doesn't require millisecond precision - this could be done with a slave controller reading the M codes. (How does the first controller know which M-codes to pass on to the slave?)
M114 is the command to ask the controller to read out its XYZ position. I don't know why the hot end needs to know that, but it's doable.
You need high-current drivers for all of the heaters and fans but all of those 2-wire devices will have one end connected to ground, you're only controlling one wire each.