"Like every complex project, there must be a preliminary design before production begins. The initial design required planning, mechanical design, and research.  With the use of Solidworks, an accurate representation of the mechanical system was modelled, and following that came drawing schematics of each part to be machined" - Kaled Salih, B.Eng. , Mech
This project was completed in a span of two months during a full-time, University Engineering study term. One month was spent for engineering, planning, and designing, and the second month for fabrication, assembly, and testing. Everything seen in this series was completely created and developed by a passion for innovation and electronics, but to only a certain extent; time and resources both have their given limits. That being said, welcome to the project overview!
Part 1 - Mechanical System
The first stage for any product is the design stage. This is where the product is thought of, created, and analyzed. 
Preliminary assembly design of the 2D CNC machine. Note the power screw (highlighted in blue) is modeled without the thread graphics, to avoid software overflow. The machine spans a width of 15"x20", with a height of approximately 15". To put that into perspective, its size is approximately that of a desk printer.
Y-Axis linear actuation system. The CNC machine utilizes a power screw system for 2D linear actuation. One power screw is required for each axis, powered by a stepper motor. The powerscrew spins through a flange nut, which is attached to the moving plate. The plate carries a solenoid and a 3D-printed fixture for the pen, allowing a small range of vertical motion for the pen.
X-axis linear actuation system. 
Once the design schematics recieved a go-ahead status, it was time to begin construction of the CNC machine. The photo shown above displays the linear rail system, which limits the nut's degrees of freedom, compelling it to move only in one direction (the desired axis of motion).
The linear rails are made of steel rods 12mm in diameter, with a lubricated and smooth surface finish that minimizes friction during translation. Linear bearings were used to provide a rolling motion during translation of the pillow blocks, instead of a dragging motion.
In order to transmit the mechanical energy from the motor to the power screw, a coupling system was adopted. One inlet of the coupler is 5/16" in diameter and the other is 1/2".
A close up representation of the machine's coupler can be seen here. Note that the choice of coupler type was no coincident; a helix coupler was selected solely for its elastic properties. When designing the machine, I chose to compensate for the possible axial misalignment caused by all of the cumulative machining tolerances. The coupler is designed with some allowance for misalignment due to its elastic properties.
Between juggling classes, labs, assignments and tests, machine shop time was very difficult to come by. As more time was made available, more parts were machined, however there were still many bore holes to be made (as seen above). 
A bearing whole requires precision, as it must have close-fit tolerances to secure the outer shell of the bearing in place such that it is stationary while the inner shell rotates. This required the use of a boring tool, which is essentially a very large chuck with an eccentric cutting tool. The eccentricity of the blade of the cutting tool can be adjusted to fit the machinist's desired radius.
Safety comes first. Once all parts completed the machining stage of the project, a deburring stage was implemented to prevent cuts and scracthes. Not to mention; it also adds a very pleasing aesthetic appeal!
Through patience and hard work, all parts and extruded features were eventually completed within a period of two weeks (during full time enrollment). Now, the assembly can finally begin. On the top left of the photo, the schematic package can be seen with the exploded view of the CNC machine (without this package, none of this would have been possible!)
After all the parts had been assembled, all of the fasteners were tightened to ensure a stable, firm and sturdy machine with minimum vibration during performance. The assembly had been transported to my home location since all machining had been completed, while all that was left was the connection of the electronics and the programming of the machine.
Part 2 - Controls
The CNC machine's main control circuit consisted of two NEMA23 Stepper motors (althought smaller size steppers could have been used for a product of this size), two TB6560 stepper driver boards, and an Arduino Mega. The stepper motors draw 2.8A of current and require a supply of 12-35VDC. A switching power supply converts mains power into 12VDC, feeding it to the drivers which control the stepper motors. At the same time, a parallel circuit extends from the outlet of the 12VDC power supply, to power the Arduino. In this circuit, a LM7805 voltage regulator regulates 12V to 5V (logic supply) at the cost of dissipated heat. In addition, a joystick is fed to the Arduino for an interactive control between the machine and the user.
Initial test of the stepper motor joystick control. The joystick is programmed to accelerate (ramp up/ramp down depending on the user's directional input). This adds a nice touch to the interaction between the user and the machine.
If one motor is possibly two control, why not two? The second stepper motor was adden in, to control the second axis of the machine.
Third test of the stepper motor drive. Note here that when the joystick is pointed such that both components are activated, the time between each loop in the Arduino's run program is heavily increased. In other words, both steppers cannot be activated at the same time without a significant decrease in speed. This issue was solved, but more on that later.
Basic drive circuit of the CNC machine. The breadboard was not sufficient to become the joystick module, so actions were taken to create something isolated and extendable.
It was deemed best fit to use a small clad board to permanently solder the joystick and all of its components.
Soldering components on to the Joystick module.
 
Skeleton design of the joystick module. Positive supply rail on the left, Ground on the right. It is designed such that any simple component can be added on with convenient and easy access to the power rails. At the bottom is a capacitive touch-sensor used as a button to activate the solenoid, allowing the user to lift the pen from the paper.
Once the basic electrical circuit was constructed, it was time to finally attached the two systems together.
Top view of the stepper motor coupling system.
Part 3 - Assembly, Testing and Tampering
Overview of the machine's assembly with the basic electrical components.
First test of the CNC machine's linear actuation. The joystick was not perfectly calibrated to match the direction of the movements, and the delay between each loop of the arduino's program was not optimized, thus causing some resonance in the system (the high-pitched screeching sound). This is the same issue that I mentioned earlier, which was solved by creating an extra function in the main program that decreases the delay in each loop twice as much when the two motors are activated at the same time.
Now that the two systems were put together, a more compact alternative to keep the circuit intact was required.
My colleague and group member, Harris Khan, cutting a 40 x 40cm plexiglass board for the base of the electrical circuit.
A more neat, organized appeal to the structure of the electrical system.
Well I didn't say it was permanently neat!
Close-up view of the TB6560 Stepper Driver boards, with the on-board controls for setting the excitation mode, decay mode, and current settings.
Close-up view of the voltage regulator circuit. The two switches are situated such that the power can be manually switched on and off, and/or isolated from the Arduino whilst the USB is connected to program it. This provides the user with the ability to save power, prevent overheating, and isolate the electrical system into 2 separate circuits.
A breadboard proved itself handy for prototyping/troubleshooting measures.
After consistent modification and re-programming of the circuit, more tests were done to make sure each changed variable did not pose any threats or errors.
Part of the design included a liquid crystal display (LCD) system that can monitor the coordinates of the spindle. The LCD was mounted at the top of the plate that carried the solenoid.
The liquid crystal library in Arduino utilizes transmission through the serial port, and depending on the baud rate and the type of information exchanged, Arduino's serial transmission tends to heavily slow down the time it takes for the main function to loop. For this reason, a separate Arduino (Arduino Uno) was used to control the LCD. In total, there are two Arduinos. The first is to control the motors and pass information to the second arduino every time it loops, so that I can keep track of the distance travelled. The second uses that information to create a coordinate display.
Testing the accuracy of the LCD's coordinate display - more calibration is required to display the correct distance travelled per loop. This was done by a series of tests, where a new constant was determined based on the error difference of the previous test. Eventually, the constant converges to a single value that best represents the real coordinate values.
Front view of the spindle; the solenoid can be seen to lift and pen up and down.
Circuit schematic for the Solenoid, with the use of an N-Type Metal Oxide Semiconductor Field-Effect Transistor (MOSFET) to allow higher values of current to flow through the solenoid whilst the switch is turned on. A pull-down resistor was used to prevent high impedance from affecting the signal.
As more progress was made with the circuit, the messier it became.  Seen above are the 16 wires carried by the LCD system to the Arduino UNO, with an addition of two terminal wires from the solenoid being fed through underneath them. Post-it notes were a necessity here; keeping track of 16 yellow wires on both ends was impossible without any form of distinction between them.
Final form of the circuit's base structure - A yellow clad board was added in to include two circuits: the LCD's potentiometer circuit and the solenoid's transistor & pull-down circuit.
2D CNC Machine - Isometric view - Final
2D CNC Machine - Front view - Final
Arduino code for the system's motor drive circuit.
Part 4 - Tradeshow
After completion, the machine was transported to campus for a project display at the annual Machine Design Tradeshow at
the University of Guelph.
Project station for the Tradeshow.
The project recieved lots of positive feedback and enjoyment from the audience of the show. People were waiting in lines just to try out the joystick and leave their mark on the battlefield!
I would like to express my deep thanks and gratitude to my team for working on this delightful project, koodos to them!
 
Left: Umna Arshad, Kaled Salih (Me), Muhammed Ashraf, Harris Khan, Mark Chubbuck, Korey Francis.
2D CNC Machine
Published:

2D CNC Machine

The 2D CNC project is a joystick controlled machine that utilizes power screw linear actuation for resultant relative motion. The system is contr Read More

Published: