For the machine design week we had one assignment, which is to build a machine from scratch using the skills we have been aquiring/refining since the beginning of FabAcademy. The idea did not come about with ease, being a team of two we had to narrow down the design to something feasible and doable in two weeks. However we both are ambitious enough to take on bigger projects no matter the complexity as long as it falls within the limited time frame that we have which is two weeks.
There are several steps that need to be taken in order to achieve the full design of the machine. The steps are chronologically found below:
Brain Storming
Right after Neil's Lecture about the machine design week, we started coming up with and discussing different ideas for a machine, we also did research where we covered the machines that have been built so far in FabAcademy.
Since most projects were plotting machines we decided to go with something similar, only we were also inspired by the digital LED screen pixel refresh, so the Idea was to build a machine that had is a combination of both. We would have one large panel that would cover the width of the face of the wall we want to paint on (x axis) and another mecanism that would bring it up and down the length of the wall (y axis). As for the Z it would be a 5x5 square that has foam, or a material that would 'drink' the ink that would be filled in the container, guided by the xy axis and pushed on to the face of the wall to mark the 'pixel'
When it came to the division of the work we had to organize a workflow chart, we were first dividing the work of the same tasks accordingly which we later found to be inefficient and time consuming so we divided the project into two main categories, electrical and mechanical.
Wael took care of the mechanical aspect and I took care of the electrical and we both helped each other. So I will be focusing on the electrical aspect of the machine on this page of documentation.
The mechanical system would mainly consist a Rack and Pinion system that would be used to move the paint module left and right on the x axis. The rack was cut using the Epilog fusion laser cutter. While the pinion was printed on the Form 2 SLA 3D printer using strong resin
The chassis of the machine itself was cut on the shopbot CNC mill using 1cm thick MDF.
The pulleys that guided and moved the machine along the y axis was also laser cut.
The tank which contains the paint in liquid form, as well as the paint application arm was 3D printed using the Ultimaker printer using PLA. The two wheels that supported the machine on the wall were also 3D printed using Black ninjaflex which is a flexible material that could handle the stress and provide traction on the surface.
Before we divided the tasks and realized that both aspects of the machine needed a lot of work, We were both working on the mechanical part and thought we would leave the electronic for later. So within the mechanical design, I designed the paint container, paint arm and servo mount for the painting module. However as it took longer than expected to achieve the complete mechanical design, we decided that I took care of the electronic aspect as we were going to run out of time.
For a more detailed description following the design and manufacturing of the mechanical parts, go to my colleague Waels page that provides this additional information as I would be mainly focusing on my part, which is the electrical aspect of the machine. However, the designs and files are found in the downloads section at the end of this page.
So first I will talk about the electronic components we used on the machine:
2 NEMA 17 Stepper motors, one for the x axis and the other for the y axis.
The Specs are as follows:
Stepping Angle: 1.8°
Motor Length: 40mm
Motor Width: 42mm
Current per Phase: 1.3Amps
Resistance per Phase: 2.5?
Inductance per Phase: 5mH
Holding Torque: 4 kg/cm
# of wires: 4
Rotor Inertia: 54g/cm^2
Weight: 0.28kg
Axial Length: 24mm
Axial Width: 5mm
The stepper motors need drivers, we chose the Stepper Driver A4988 , which would then be connected to an Arduino to be controlled.
As for the Z axis we chose a Servo motor that would be the DSS-P05 since it has enough torque to push our Z axis with the resistance of the spring system that would take our Z axis back.
To control our machine we used an Arduino, as for the actual control we have two available options:
We have 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.
Code found to manually control the Plotter is found below:
// Libraries
#include
//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) { // goes from 0 degrees to 180 degrees
// 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
}
}
}
The second option which would completely automize it by using a G-code. The Gcode was generated on Fabmodules and sent to the Arduino that had the GBRL software uploaded and then using a software called Universal g-code sender (by UGS) that would 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. Yet below is a simple test with the process of running a Gcode
downlad a Universal Gcode Sender (UGS) to be able to generate the code and run the control pannel. Many versions are found on Github. In my case it is version 1.0.9 and GBRL version 1.1 (code)
The downloaded file would be a folder that contains several files, the UGS would be the .jar file.
Then you need to download and import the Gcode library. It would be saved as an example in the arduino IDE under File/Examples/GBRL.
Upload the code/example to the Arduino. Do not Alter anything, the library is what contains the actual code and the process in the IDE is to run it.
Make the connections between the stepper motor and a4988 stepper driver module shown above. Then you would need to connect the module Direction and Step pins to the Arduino. For this example I only used one axis which is the X. So the Step pin of the a4988 driver goes to PIN 2 of the Arduino and the Direction to PIN 5. The image below would show where the rest of the pins need to be to take full advantage of the Gcode and the project at hand.
Once you have all connections made, connect the Arduino to the PC and open the UGS software.
Using fabmodules, Upload any monochrome(black white) png image and make out the traces to calculate and generate a Gcode, Then save the code onto your PC I chose to save the file in .nc format and it worked.
In the UGS platform, first select the port where the Arduino is connected. And make sure of the Baud rate then click open. The UGS platform should now establish communication with the Arduino.
Now click on the file mode tab and use the browse button to upload the file that has been downloaded from fabmodules which contains the Gcode.
Once the file is uploaded to the UGS, hit send and the process should start. You can also click the visualize button to see where at which stage the process is.