Mechanical and Machine Design - Assignment 14-15

Discovering Machine Design

So the objective of those two weeks was to discover and experience how to design and build a mechanical machine that can accomplish a certain goal or objective by a system of mechanical components, electric circuit, and a controlling code.

This week had a wide range of ideas that could be done. Many ideas could be found in previous Fab Academy years and on other online resources. We can make a CNC Machine, a plotter, laser cutter, 3d printer and many other more, all of which have the same main concept, a sytem of stepper and servo motors, that control a specific head, to produce a specific final product.

We had a Group Assignment for two week.
  1. Week 1 - Group Assignment
  2. The group assginment was to design a machine that includde mechanism, actuation and automation. We had to build the mechanical parts and operate it manually.
  3. Week 2 - Group Assignment
  4. The assignement of the second week was to actuate and automate our machine.
You can check the Group Assignment on the following link: Group Assignment

Machines Used

The main machines used in this week's assignment are the CNC Machine, Laser Cutter and 3d printers.
  1. Epilog Fusion M2 120 Watts was used for laser engraving and laser cutting in this assignment. This Epilog Fusion M2 uses the CO2 Laser Technology to cut and engrave. The laser source is guidged by 2 axis (X and Y) that guide the focal point of the laser where cutting will occur.
  2. Shopbot which is the biggest CNC Router we have in the lab.
  3. Ultimaker 3 and Ultimaker 3 Extended is one type of the FDM 3d printers. It was used for 3d printing small scale objects up to 20x20x30 cm.
  4. Form 2 is our SLA 3d Printer. It was used for high-resolution prints.

Software Used

The following software were used for 2D Vector Design in this week's assignment:
  1. Fusion 360 was used for 3d modelling in this assignment.
  2. CorelDraw
  3. was used to make fast 2D designs mainly for testing the different capabilities of the Laser Cutter. It is an easy software that could be used for color mapping.
  4. AutoCad
  5. was the main software used for 2D design. I used it to design the Press-Fit Kit.

1- Mechanical Design and Production





Brainstorming

So the first step in this project was to design our machine after many brainstroming sessions. We had many different ideas that could achieve the same result. However, as all brainstorming sessions, ideas changed rapidly and we tried our best to keep the idea feasible and doable in one week.

We first wanted to build a machine that could paint on a wall, either using spray paint, a roller, or anything that could apply paint on a wall. However, using spray paint would complicate the machine, especially if we want to used compressed air. So we decided to scale the project down and use the concept of a highlighter, meaning a sponge head to apply the paint on a wall. The idea is that the spongy head, which is 5cm x 5cm will apply paint by pushing on the wall, leaving a 5x5 square. So we can draw a big image on any wall, by converting it into monochrome image, and printing it in pixels on the wall.

Brainstorming

Preparing the 3d Design


The 3d model of our project was built on Fusion 360, mainly because you can build the different components on the software and assemble them together on the software. THe various parts that were mainly included in the machine design were the following:

  1. Rack and Pinion system that will achieve the horizontal left and right motion
  2. Frame of the machine that is designed to be made of 1cm thickness MDF and assembled using nuts and bolts
  3. Pulley system that will achieve the Vertical up and down motion
  4. Coloring Tank that will carry paint inside it
  5. Paint Applicator which constitute of a tube that moves along one axis, and pushes the painting head on the painted surface
  6. Main Plate that will carry the paint tank, the applicator, and the steppr motor connected to the pinion. This plate with the rack and pinion system is what provides the horizontal motion
  7. Front Wheels that will guarantee a constant distance betweent he machine and the surface as they roll on top of it
The video below shows how the final design was reached. You can download the design from the following Link.


Manufacturing the Different Parts


After preparing the 3d design of the whole machine, the next step was to start manufacturing the different parts. Each part was produced using a different technology available in the lab, to achieve the best final product.
The main digital fabrication tools that were used in this project was the following:

  1. Epilog Laser Cutter
  2. Shopbot CNC Milling Machine
  3. Ultimaker FDM 3d Printer
  4. Form 2 SLA 3d printer

CNC Machining

Most of the parts in our machine were produces using the CNC milling machine, mainly the main frame of the machine and the various parts that formed the pulleys. The DXF files were extracted from the sketches of the Fusion 360 design and then inserted on Vcarve to produce the g-code, which will then be used to machine the parts. All the parts were milled from a !cm thicness MDF sheet. You can download the original files used for machining from the following link CNC Machining Files


Laser Cutting

Other parts required high pricision in the production process, mainly the Rack gears, as they were hard to produce using cnc milling due to the small distance between the rach teeth that cannot be covered by the milling bit we have in the lab. The rack was produced from a 1cm thickness MDF plate.
The other part that was laser cut was the Main plate that will carry the painting kit. This part was cut from a 5mm thickness Acrylic sheet.
You can download the original files used for machining from the following link CNC Machining Files


Laser Cutting

3d Printing

Various parts were produced using 3d printing, mainly the 3d parts that we were planning to produce in plastic and flexible material.
Two different 3d printing technologies were used for the production process:

  1. FDM 3d printing using the Ultimakers
  2. SLA 3d printing using the Form 2

Also diffrent material were used for the different parts printed
  1. Silver PLA were used for the wheels that will carry the main plate on the rail.
  2. Silver PLA was also used for the printing head and the tube
  3. Red PLA was used for the main tank that will carry the painting material
  4. Green PLA was used for the support that will carry the Front wheels
  5. Black PLA was used to printing the Servo Motor Stand and Pulley
  6. Black NinjaFlex, is the fexible material used to print the fron wheels to profide traction with the painted surface.
  7. Tough Resin was used to print the Pinion gear.
Details about the results will be shown in the next section below.

You can download the original files used for our tests from the following links: 3d printing files

3d printing

2- Assembling the Machine



2D Design

After producing all the different parts using the different technologies, the next step is to assemble all parts together to make a functional machine.


Preparing all parts

Before final assembly of the machine parts, the first step was to make sure that they all fit together, in order to make final edits before assembling. All the different parts were tested together, to make sure that they will achieve the job they are meant to do. All parts fitted perfectly together, but the pinion gear was getting stuck between the guiding plats, cause the MDF plate used was not a perfect 1cm, in fact it was 9.5 cms. So we had to do some edits on the pinion gear and re-print it so it can move loosly.

Parts

Assembling the Machine

Next we assembled all parts and we tried to test that all parts move as they are supposed to move before starting with the electronics and control part. As a first step, we made sure that the main mounting plate, that will carry the paint applicator, moves freely on the horizontal axis, on the designed rail. It worked.

Next we assembled the pulley system using the CNC milled pulleys and chasis plates, and a set of standard GP2 pulleys and belt. In addition, guiding rods of diameter 8mm were used as the asxis for the main pulleys that will carry the puuling cable. A 20 tooth pulley was fixed on the axis of the Nema 17 stepper motor, and a 40 tooth puller was fixed on the axis of main pulleys. This would achieve a 2:1 gear ratio between the source and the driven pulleys, thus achieving a higher torque.


Assembling

Testing the Machine Mechanism

After assembling all parts of the machine, and making sure that each part does its specific job, the next step was tomake sure that the whole system works correctly all together before installing the electronic components and working on the control part.
The video below shows how the system worked by moving it manually by hand. Both the horizontal motion and the pulley system worked according to the designed concept. The next step is to start controlling it and checking if it works for real.


3- Preparing the Electric Circuit and Code





After preparing all the mechanical parts of the machine, the next step was to install all the electro-mechanical components such as the Stepper Motors and Servo-motor and build the electric circuit along with the control of the circuit.

Based on the needed circuit, the code that will be downloaded on the micro-controller and that will control the machine was written accordingly.
Two different scenarios were followed to control our machine:

  1. Scenario 1: Controlling the machine manually using a joystick. This will allow us to move the machine and print on demant by a push of a button
  2. Scenario 2: Controlling the machine using a g-code generated using any g-code generaotr, by the help of the GBRL software uploaded on the controlling Arduino Board


Components Used

The main electronic components we used in this machine are the following:

  1. NEMA 17 JK42HS40-1304F, that controlled the horizontal and vertical motion of the painting head
  2. Stepper Driver A4988 that was used to control the stepper drivers used
  3. Servo Motor DSS-P05 that was used to push the paint applicator forward and backwards
  4. Joystick that was used to control the machine maually.

components

Controlling Code - Example 1

After Designing the system and connecting all the components that we are using in this machine, the next step was to write the controlling code. the first option we designed a manual option of controlling the machine using a joystick, Left Right for x axis and Up Down for the y axis, pressing the middle button would activate a 180 degree cycle on the servo to control the z axis.

The first video represents how the code control the different electric components before installing them on the machine on the machine. The joystick controls the two stepper motors and the servo motor.So we first made sure that the system theoretically works.

Next we added the electric components to the mechanical parts of the machine. The horizontal axis worked as wanted, as shown in the second video. However, due to the weight of the machine, the vertical axis wasn't efficient as the motor was not able to pull the system to the top. Plus the rope was locking inside the pulleys due to the whole system's weight. So the only functional use on the vertical axis was mainly using the stepper motor as a breaking system. So if we start the machine from the top, we can go down to a certain level and then stop by the help of the stepper. But also, some slippage occured which caused the horizontal to be oblique.

Below is the code used to control our machine using a joystick:
// Libraries #include <Servo.h> //Servo Servo myservo; int pos = 0; //Joystick Control #define Joy_switch 13 int UD = 0; //js int LR = 0; //js int IUP=A0; int ILR=A1; int MID = 10; // 10 mid point delta arduino, use 4 for attiny int LRMID = 0; int UPMID = 0; // Connections to A4988 (Stepper Driver) const int dirPin1 = 2; // Direction const int stepPin1 = 4; // Step const int dirPin2 = 7; const int stepPin2 = 8; // Motor steps per rotation (Stepper) const int STEPS_PER_REV = 200; void setup() { //Stepper Setup pinMode(stepPin1,OUTPUT); pinMode(dirPin1,OUTPUT); pinMode(stepPin2, OUTPUT); pinMode(dirPin2, OUTPUT); //Servo Setup myservo.attach(9); LRMID = analogRead(ILR); UPMID = analogRead(IUP); pinMode(Joy_switch, INPUT_PULLUP); //pinMode(MID, INPUT); } void loop() { //Read Joystick UD = analogRead(IUP); LR = analogRead(ILR); // UP-DOWN if(UD < UPMID - MID){ // Set motor direction clockwise (HIGH) digitalWrite(dirPin1,HIGH); // Spin motor quarter rotation slowly for(int x = 0; x < (STEPS_PER_REV / 4); x++) { digitalWrite(stepPin1,HIGH); delayMicroseconds(2000); digitalWrite(stepPin1,LOW); delayMicroseconds(2000); } } if(UD > UPMID + MID){ // Set motor direction counterclockwise (LOW) digitalWrite(dirPin1, LOW); // Spin motor quarter rotation slowly for(int x = 0; x < (STEPS_PER_REV / 4); x++) { digitalWrite(stepPin1,HIGH); delayMicroseconds(2000); digitalWrite(stepPin1,LOW); delayMicroseconds(2000); } } // Pause for one second //delay(1000); // LEFT-RIGHT if(LR < LRMID - MID){ // Set motor direction counterclockwise (LOW) digitalWrite(dirPin2,LOW); // Spin motor quarter rotations quickly for(int x = 0; x < (STEPS_PER_REV / 4); x++) { digitalWrite(stepPin2,HIGH); delayMicroseconds(2000); //changed to high was (1000) digitalWrite(stepPin2,LOW); delayMicroseconds(2000); //changed to high was (1000) } } if(LR > LRMID + MID){ // Set motor direction counterclockwise (HIGH) digitalWrite(dirPin2,HIGH); // Spin motor quarter rotations quickly for(int x = 0; x < (STEPS_PER_REV / 4); x++) { digitalWrite(stepPin2,HIGH); delayMicroseconds(2000); //changed to high was (1000) digitalWrite(stepPin2,LOW); delayMicroseconds(2000); //changed to high was (1000) } } // Pause for one second //delay(1000); //Joystick Switch if (!digitalRead(Joy_switch)) { // Servo sweep 0 - 180 and back for (pos = 0; pos<= 180 ; pos += 1) { // in steps of 1 degree myservo.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15ms for the servo to reach the position } for (pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees myservo.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15ms for the servo to reach the position } } }

You can download the Arduino code used from the following Link




Controlling Code - Example 2

The second option was to completely automize it by using a G-code. The G-code could be generated using Fab modules and sent to the Arduino that has the GBRL software previouly uploaded on. Next using a software called Universal g-code sender (by UGS), we will feed the commands to the machine. This option is still not fully functional as it still needs a lot of calibration on the g-code.

To test this option, the following stepps were followed:

  1. Download the UGS (Universal G-code Sender) to be able to control the machine using the on-screen control panel, and to send the g-code t the machine once it is ready. In our case we used 1.0.9
  2. Download the GBRL v1.1 file, which the g-code parser.
  3. Download the G-code library and then upload the "GBRLtoArduino" Example code onto the Arduino board
  4. Make the connections to the Arduino according to the image. The stepper motors are not directly connected to the Arduino board. It is connected to the Stepper driver, Polulu a4988, that is connected to the Arduino board using 2 digital pins, one used for the steps and the other used for the direction.
  5. Once all connections are made, and all the codes are downloaded, the next step is to connect the Arduino board to the computer and open the UGS software
  6. Generate a g-code using fab modules by inserting a monocrome image in png form. Then save the g-code on the computer.
  7. On the UGS software, choose the port where the Arduino is connected, and upload the g-code using the browse button.
  8. Once everything is ready, send the gcode to the board and enjoy. You can simulate the proces by clicking the "Visualize" button
the video shows how the stepper motor works using the GBRL software.

For the same reason mentioned before, the machine could not be operated due to the weight of the machine which was causing locking on the vertical axis.

For more details, please refer to my colleugues page using the following link: Ghassan's Page

GBRL

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License