Commit 45a60419 authored by anithghalley's avatar anithghalley
Browse files

machine week

parent 4627601b
Pipeline #314627 passed with stage
in 46 seconds
# 12. Mechanical Design
This week I worked on defining my final project idea and started to getting used to the documentation process.
This week is about making a machine and funny thing is all my group mates came positive for covid and that gave us time to work together since we had to isolate ourself. And with us was Fran and Sibu. It was a great experience to work in group giving and taking inputs for a common goal.
## Research
![](../images/machine_making/machine_week.png)
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
## Week Assignments
> "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
- group project for Mechanical design:
## Useful links
- design a machine that includes mechanism, actuation, automation, application.
- Build the mechanical parts and operate it manually
- document the group project and your individual contribution
- [Jekyll](http://jekyll.org)
- [Google](http://google.com)
- [Markdown](https://en.wikipedia.org/wiki/Markdown)
## Code Example
- group assignment for Machine design:
Use the three backticks to separate code.
- actuate and automate your machine
- document the group project and your individual contribution.
```
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
}
## Group Assignment.
// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
```
The group assignment can be found [here.](https://fabacademy.org/2022/labs/bhutan/students/kencho-wangdi/assignments/week15group/)
## Gallery
The link to the video is [here.](https://fabacademy.org/2022/labs/bhutan/videos/bhutan_groupB.mp4)
![](../images/sample-photo.jpg)
## Machine.
## Video
So, the first and for most thing is to decide what machine we are going to make. It was a good brainstroming among ourselves and finally we decided to make a machine which can convert pet bottle to 3D printing filaments. The waste bottle has become a kind of use and throw purpose and waste is a big problem in all part of the world.
### From Vimeo
The machine concept is almost done then we divided the work to each where for some work we were supposed to work individual and few in pairs. We elected Zina Choden as our team leader and she managed to divide the work very carefully and she did a great job leading the team.
<iframe src="https://player.vimeo.com/video/10048961" width="640" height="480" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
<p><a href="https://vimeo.com/10048961">Sound Waves</a> from <a href="https://vimeo.com/radarboy">George Gally (Radarboy)</a> on <a href="https://vimeo.com">Vimeo</a>.</p>
## Team Members Responsibilies.
### From Youtube
1. Zina Choden Yonten
<iframe width="560" height="315" src="https://www.youtube.com/embed/jjNgJFemlC4" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
- Team Lead
- 3D design
- Documentation
## 3D Models
<div class="sketchfab-embed-wrapper"><iframe width="640" height="480" src="https://sketchfab.com/models/658c8f8a2f3042c3ad7bdedd83f1c915/embed" frameborder="0" allow="autoplay; fullscreen; vr" mozallowfullscreen="true" webkitallowfullscreen="true"></iframe>
2. Sonam Paldon Dorji
<p style="font-size: 13px; font-weight: normal; margin: 5px; color: #4A4A4A;">
<a href="https://sketchfab.com/models/658c8f8a2f3042c3ad7bdedd83f1c915?utm_medium=embed&utm_source=website&utm_campaign=share-popup" target="_blank" style="font-weight: bold; color: #1CAAD9;">Dita&#39;s Gown</a>
by <a href="https://sketchfab.com/francisbitontistudio?utm_medium=embed&utm_source=website&utm_campaign=share-popup" target="_blank" style="font-weight: bold; color: #1CAAD9;">Francis Bitonti Studio</a>
on <a href="https://sketchfab.com?utm_medium=embed&utm_source=website&utm_campaign=share-popup" target="_blank" style="font-weight: bold; color: #1CAAD9;">Sketchfab</a>
</p>
</div>
- Programming
- Hall Effect sensor team
- Documentation
3. Anith Ghalley
- Hall Effect Sensor team (mechanism)
- Programming
4. Kencho wangdi
- Extruder modification
- Assemble components
- Prototyping
- Wood works
## Working in group.
The picture below was taken when we were finally able to come back to lab after being covid positive. Initially it was tough working with the sickness but with a good company, any tough journey is worth it.
![](../images/machine_making/machine_team.jpeg)
The picture above is the team member of group B-positive. It felt great working with this people, our team members comes from a diverse background such as Mechanical engineer (Zina Choden), Bio-technologist (Kencho Wangdi), Electrical Engineer (Sonam Paldon Dorji) and I am an electronic and communication engineer.
It was a great experience because our team with different background helped us analyse a problem from all different approaches and prepectives.
## My Work.
I was assigned to work with Sonam Paldon to:
1. Design an amplifying mechanism.
2. Programming the machine.
### Mechanism.
With our approach to convert the pet bottle to 3D filament has the high possibility of creating an uneven diameter of the filament. Therefore it is necessary to control the extrusion of the filament as per the diameter of the filament from the extruder.
![](../images/machine_making/mechanism_concept.jpeg)
Our mechanism must be able to detect the variation of about 0.5 mm in the diameter of the filament. Therefore our Aim is to create an amplifying mechanism which would have an amplification factor of x20. SInce we want to use the Hall effect Sensor to detect the variation.
As per the video in the Input week design of the hall effect sensor. We have observed that a considerable variation of 2 cm is required for the hall effect to detect a measurable variation between the sensor and the magnet.
Therefore, after a quite a long time of brainstorming and exploration we decided to use the concept of first class lever.
![](../images/machine_making/arm_lever.png)
The Ratio between the Load Arm to the effort Arm will give us the scale with which the movement of the effort arm will make a huge variation at the end of the load Arm.
With this concept, we have designed a combination of two first class levers. Where the load arm of the first lever will create a huge variation to the load arm of the second lever.
![](../images/machine_making/amp_scale.jpeg)
The First iteration of the mechanism was a to basically create the combination of the levers.
![](../images/machine_making/pivot_mechanism.png)
The we understood that the pivoted point would need some joints, which should provide the freedom for rotational movement but should restrict translational movement.
![](../images/machine_making/3rd_iter.png)
But all these joints broke while removing the support after printing. Therefore we are now looking forward to making more reliable joints in the future iterations of the design. For now we manually created the pivoted points at the support and at the lever to test the amplification of the mechanism.
![](../images/machine_making/joints_in%20_machine.jpeg)
Finally the mechanism was installed on the machine. Then we tried to check variation on the output from the hall effect sensor. When the filament passed through the pathway, the variation on the hall effect output was observed. Therefore, we plan to take this output from the hall effect board and control the speed of the motor.
### Programming.
For this machine development, we will be using the Arduino Mega and on it we will be using ramps to controll the components in our machine.
![](../images/machine_making/ramps.png)
The components or modules required for our machine is shown below.
![](../images/machine_making/connection_real.jpeg)
The components are:
1. Power supply (230 AC to 12 V DC).
2. Arduino Mega.
3. 3D printer Extruder.
4. Stepper Motor.
5. Motor Driver.
6. 12 V fan.
7. 4x16 LCD.
Basically the connection of these components to the ramps is listed below.
1. The power supply converts the 230 V AC Supply to 12 V DC.
2. The 12 V supply is connected to the ramps.
3. The stepper motor is connected to the E0 with a motor driver.
4. The Extruder goes to D10 for power supply and is connected to T0 to sense the change of temperature.
5. Fan to the 12 aux.
6. LCD to the AUX-4 Pins.
To programm to machine we used the [marlin firmware](https://marlinfw.org/meta/download/), since this firmware will allow us to configure the program based on our requirments of using different components.
![](../images/machine_making/marlin.png)
And to tune the extruder, controlling the motor and temperature of the extruder we will be using the [cncjs.](https://github.com/cncjs/cncjs/releases)
**Motor :**
![](../images/machine_making/stepper_motor.png)
As mentioned above the stepper motor is connected to E0 and the motor will be controlled using the motor driver like shown below.
![](../images/machine_making/motor_driver.png)
To change the resolution of the motor from 200 steps to 1600 steps we shorted the MS1 and MS2 jumper as indicated below.
![](../images/machine_making/motor_resolution.png)
![](../images/machine_making/moto_shorted.jpeg)
Next Sonam and I tried to limit the current for the motor driver to 0.047 V.
![](../images/machine_making/current_limit.jpeg)
**Extruder :**
I heard few bits about PID but never worked on it. So here we learned to [auto-tune](https://reprap.org/wiki/PID_Tuning.) the PID for the extruder on the cncjs software.
![](../images/machine_making/PID.png)
So the final task was to make the necessary changes on the marlin firmware to meet our requirments for the machine.
Set the value for the motor which is connected to E0.
![](../images/machine_making/marlin_e0.png)
And now take the tuned value of PID and add it to the PID value on the firmware.
![](../images/machine_making/autotuning_marlin.png)
Uploading the program to the arduino Mega.
![](../images/machine_making/upload.png)
## Outputs.
- Filament Produced.
![](../images/machine_making/pet_filaments.jpeg)
- Printing with the filament.
![](../images/machine_making/print.jpeg)
- Using one coca cola bottle we were able to produce 500 cm long filament.
![](../images/machine_making/filament_length.jpeg)
## Future Works.
- Designing a mechanism whith higher amplifying factor.
- Make better holder for the extruder.
- Make the machine even more user-friendly while operating.
- Reduce the size of the machine, so it is portable.
- Incorporate spool holder so that filament produced can be automatically stored.
- Incorporate the output from the hall effect board to control the speed of the motor.
- Improve the overall aesthetic of the machine.
\ No newline at end of file
......@@ -14,7 +14,7 @@ Send a message between two projects
design, build, and connect wired or wireless node(s) with network or bus addresses
# Communication Protocol.
## Communication Protocol.
The proper descriptions of digital message formats as well as rules are known communication protocols. The main function of these protocols is to exchange messages from one computer system to another. These are significant in telecommunications systems as they consistently send and receive messages. These protocols cover error detection & correction, signaling, and authentication.
......@@ -49,7 +49,7 @@ Asynchronous transmission is also know as start or stop transmission. It sends d
Synchronous data transmission is a data transfer method in which a continuous stream of data signals is accompanied by timing signals. This type of communication can be virtual as well, either scheduled or a little more impromptu.
# ESP32 Webserver.
## ESP32 Webserver.
In this assignment I tried to create an ESP32 webserver to host an interface to control one of the programmable LED in my circuit board.
......@@ -82,7 +82,7 @@ And the next step was to assign the footprints to the components. The assign foo
The footprint for the audio jack connector is downloaded from the snapeda website and the footprints is added to project specific.
## PCB layout.
### PCB layout.
While making the layout of the board, the audio jack slots were not connected with any of the component like shown below.
......@@ -104,7 +104,7 @@ The final PCB layout is done but I forgot to ran the rule checker, Therefore res
The third box was not unconnected track but the PCB outline was so close to the trace. later after milling the PCB, certain improvising tasks were performed.
## PCB Milling.
### PCB Milling.
Inkscape was used to convert the svg file png file and white background was added to the file. And the SRM 20 machine was used to mill the board.
......@@ -129,7 +129,7 @@ such as:
![](../images/networking_week/Improvise.jpg)
## Testing of board.
### Testing of board.
To test the board, when I connected the FTDI programmer the power LED glowed.
......@@ -212,14 +212,14 @@ The code can be found at the end this page. After the code is uploaded, switch t
![](../images/networking_week/ip_address.png)
And from the browser, provided connected to the same network.
And from the browser we can access the webserver with some interface, provided connected to the same network. The vide
```
Video of controlling LED
```
<video width="600" controls>
<source src="../../images/networking_week/videos/networl_test_2.mp4" type="video/mp4">
</video>
# Files.
## Files.
- [ESP32 Webserver code](../files/Networking/ESP_webserver/ESP_webserver_code.ino)
- [ESP Kicad File](../files/Networking/jacked_ESP32.zip)
\ No newline at end of file
......@@ -19,7 +19,7 @@ int pos = 0; // variable to store the servo position
int servoPin = 32;
// Setting Static IP.
IPAddress local_IP(192, 168, 1, 115);
IPAddress local_IP(192, 168, 2, 115);
IPAddress gateway(192, 168, 1, 1);
IPAddress subnet(255, 255, 255, 0);
IPAddress primaryDNS(8, 8, 8, 8); //opcional
......
/*********
Rui Santos
Complete project details at https://randomnerdtutorials.com
*********/
// Load Wi-Fi library
#include <WiFi.h>
#include <ESP32Servo.h>
// Replace with your network credentials
const char* ssid = "SSID";
const char* password = "PASSWORD";
// Set web server port number to 80
WiFiServer server(80);
// Variable to store the HTTP request
String header;
String header1;
// Auxiliar variables to store the current output state
String output4PinState = "n";
// Assign output variables to GPIO pins
const int output4 = 4;
// Current time
unsigned long currentTime = millis();
// Previous time
unsigned long previousTime = 0;
// Define timeout time in millisecmds (example: 2000ms = 2s)
const long timeoutTime = 2000;
Servo myServoLeft_1_a;
Servo myServoUltra; //create servo object to cmtrol a servo
// 16 servo objects can be created m the ESP32
int servoLeft_1_a = 32;
String estado = "";
int wait30 = 30000;
int prevAngle = 90;
ESP32PWM pwm;
void setup() {
Serial.begin(115200);
// Initialize the output variables as outputs
pinMode(output4, OUTPUT);
//pinMode(output27, OUTPUT);
// Set outputs to LOW
digitalWrite(output4, LOW);
//digitalWrite(output27, LOW);
// Cmnect to Wi-Fi network with SSID and password
Serial.print("Cmnecting to ");
Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
// Print local IP address and start web server
Serial.println("");
Serial.println("WiFi cmnected.");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
server.begin();
delay(200);
ESP32PWM::allocateTimer(0);
ESP32PWM::allocateTimer(1);
ESP32PWM::allocateTimer(2);
ESP32PWM::allocateTimer(3);
//
myServoLeft_1_a.setPeriodHertz(50);
myServoLeft_1_a.attach(servoLeft_1_a , 1000, 2000);
delay(100);
}
void loop(){
// If discmnected, try to recmnect every 30 secmds.
if ((WiFi.status() != WL_CONNECTED) && (millis() > wait30)) {
Serial.println("Trying to recmnect WiFi...");
WiFi.disconnect();
WiFi.begin(ssid, password);
wait30 = millis() + 30000;
}
// Check if a client has cmnected..
WiFiClient client = server.available();
if (!client) {
return;
}
Serial.print("New client: ");
Serial.println(client.remoteIP());
// Espera hasta que el cliente envíe datos.
// while(!client.available()){ delay(1); }
/////////////////////////////////////////////////////
// Read the informatim sent by the client.
header = client.readStringUntil('\r');
Serial.println(header);
if (header.indexOf("on") != -1) {digitalWrite(output4, HIGH); estado = "LED4 ON"; Serial.println("On");}
if (header.indexOf("off") != -1){digitalWrite(output4, LOW); estado = "LED4 OFF"; Serial.println("Off");}
if (header.indexOf("servo") != -1){ Serial.println("servo");
int angle = getAngle(header);
//Serial.println(angle);
myServoLeft_1_a.write(angle);
delay(500);
}
//if (req.indexOf("off14") != -1){digitalWrite(LED14, LOW); estado = "LED14 OFF";}
//myservo.write(angle);
//delay(1000);
// Clear the header variable
header1 = "";
// Close the cmnectim
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println(""); // Comillas importantes.
client.println(estado); // Return status.
client.flush();
client.stop();
Serial.println("Client disconnected.");
}
// Get servo value from ip
int getAngle(String url){
char servo[15];
char angle[4];
int sub = 11;
url.toCharArray(servo, 15);
for(int i=11; i<15; i++) {
sub = i - 11;
angle[sub] = servo[i];
//Serial.println(servo[i]);
}
//angle[4]= '\0';
int angleValue = atoi(angle);
//Serial.println(angleValue);
return angleValue;
}
// Http Get
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment