In this project we will learn about robotics and a more material engineering
The goal of this project is to create a rolling robot that can be controlled with your phone
Today I learned how to program a servo to move back and forth as well as how to wire a servo.
We programmed a servo to move back and forth, in short we transferred the tinkerCAD into real life.
I added a servo to pin 8 and added it into the other servo's programming.
I edited the coding a little to make the 2 servos move independently, it was easy since they were already wired separately.
We built a test prototype on TinkerCAD before trying it in real life.
We learned to power our circuits with only batteries. We spliced together wires letting us connect batteries to our arduino and servos.
I created a stable body for my robot using PVC as the base. I also added a cardboard hood creating a second layer, as you can see a section is moveable to allow access to the batteries.
In this video I programmed the servos to go forwards and backwards as well as perform a left and right tank turn.
My first attempt at completing a track. Small errors but nothing that cant be fixed in an hour or so.
#include <Servo.h> //servo library
Servo myservo; //define object
Servo notmyservo;
int pos = 0; // variable to store the servo position
void setup() {
myservo.attach(9); // attaches the servo on pin 9 to the servo object
notmyservo.attach(8);
}
void forward(){
myservo.write(0);
notmyservo.write(180);
}
void backwards(){
myservo.write(180);
notmyservo.write(0);
}
void right(){
myservo.write(0);
notmyservo.write(0);
}
void left(){
myservo.write(180);
notmyservo.write(180);
}
void loop()
{
myservo.write(0);
notmyservo.write(180);
delay(4500);
myservo.write(0);
notmyservo.write(0);
delay(500);
//first straight then right turn
myservo.write(0);
notmyservo.write(180);
delay(5300);
myservo.write(0);
notmyservo.write(0);
delay(550);
//Top straight then turn downwards
myservo.write(0);
notmyservo.write(180);
delay(4000);
myservo.write(180);
notmyservo.write(180);
delay(500);
//downward sraight then turn left
myservo.write(0);
notmyservo.write(180);
delay(2800);
myservo.write(180);
notmyservo.write(180);
delay(500);
}
Today we learned how to create functions which greatly simplifies coding and speeds up the process.
Describe at least one “physical” iteration to your robot that you have made, answering these prompts:
How did you know that you needed to make a change to your robot (describe the testing process and what you learned from testing). Include a picture if you are able.
I noticed that my robot’s wheels were slipping and did not have a good grip on the floor.
What specifically did you change?
I added rubber bands around the wheels which added much needed traction.
How did you know/verify that your change helped your robot’s function?
After this My robot went much faster and turned much faster as the wheels no longer slipped.
Describe at least three “iterations” to your code that you have made, in order (three successive changes):
How did you know that you needed to make a change to your code (describe the testing process and what you learned from testing). Include a line of code to aid in your description if you are able. Originally, when attempting to get my robot to go forward, I typed:
for (pos = 0; pos <= 3600; pos += 1) {
myservo.write(pos); delay(5);
What specifically did you change? Include a line of code in your description.
I changed this to a much more simplistic servo.write which helped me edit my code faster
How did you know/verify that your change helped your robot’s function?
I was able to alter my robots code much easier, usually I only had to type two or three numbers.
Today we implemented an ultrasonic sensor that can measure distance, this will be useful as the robot can now sense obstacles.
The ultrasonic sensor has been programed to make the robot turn when faced with an obstacle such as a wall. Theoretically, this robot could now complete a maze given enough time.
We learned how to make our robots faster with larger wheel or a gearbox, I'm going to go with a gearbox and build another one of these as it seems to work better.
Using the sensor I was able to make the robot avoid walls.
Rip fence: Makes sure material cuts straight, for rip cuts
Miter gauge: Holds pieces of an angle, for cross cuts
Use push stick when near blade as always
No loose clothing
Removes the top of a material. Reduces thickness of a material. Makes it uniform and smooths the surface of the material.
We continually inserted pieces of wood into the planer until they were even and smooth on both sides.
Keep hands outside placement line. Measure material while it is on the saw. Don't touch or manually move the blade guard, it automatically retracts.
Cuts biscuit shaped holes so things can be accurately and perfectly connected. Creates sturdy connections.
Uses a CAD file to cut pieces of a material. One of he most expensive machines at Drew.
Dont leave while cnc is running
do not go near gantry while running
secure material with clamps and/or screws
Smoothes out surfaces and prepares wood for staining. Danger to skin so make sure to check your hand placement. Do not put the sander on damageable surfaces. DO NOT TOUCH SANDPAPER WHILE OPERATING
Electro magnetizes a piece of metal seeking the lid from moving. When remotely or locally disabled it no longer is magnetized to the lid is free to move. I plan to have a hidden button rigged to an arduino that will turn the electromagnet on and off . This would be possible in class as all I'd have to do is buy or construct an electromagnet.
A barrel that is attached to a deadbolt cannot turn. This is because it is blocked by segmented pins. When all the pins are aligned, the spaces between the segments should line up allowing the barrel to turn and the bolt to be retracted. This would be possible in class but muich harder than other options as it would be a complicated process.
Electronic lock controls a motor/servo attached to a bolt. When the correct combination is entered the motor/servo is activated and withdrawn. This would also be possible in class but is a little too simplistic for me to consider.
A latch rests on several cogs that have randomly placed notches, when the notches line up the latch falls into place allowing the bolt to be moved. This is possible as we are constructing a combination lock in class.
I would like to create a lock using electromagnetism, I could affix the electromagnet on the lid of the box and have a switch turning it on and off for when you want it to be locked as well as a hidden override button.
Wear gloves
Stain over drop cloth
use small amounts of stain on rags
use cotton cloth to apply stain
Do not mix stain
My initial idea was to use the bought electromagnet and design a unique switch design to toggle it on and off to lock and unlock the box lid. However, I was not allowed to use the store-bought electromagnets so i decided to scrap the idea and start from stratch
My second idea was to use a DIY electromagnet constructed out of a bolt and wire. Wrapping the wire around the screw and sending a current through it would result in an electromagnetic field. I planned to use this to slide a separate bolt that was attached to the lid in and out of the side of the box preventing the lid from moving when engaged. However, I found that it is relatively complex to make an electromagnet repel things so I went back to the drawing board on the locking mechanism.
I decided to make locking a manual step and have the bolt be attracted into the side of the box via the user placing a magnet near it as the bolts were slightly magnetic. Then the electromagnet could attract the bolt pulling it out of the wall to unlock the box.
During this iteration, I created a switch that consisted of a box with 2 aluminum contacts and a paperclip glued to a magnet. Under normal circumstances, the paperclip would be sitting around and when you needed to unlock the box you could place the magnet between the contacts completing the circuit and turning the electromagnet on, effectively unlocking the box.
I fixed the contact issue with the "switch by bending the aluminum at an angle to it has a near perfect chance to always contacting both sides of the switch.
After a few stages of testing, I concluded that the voltage needed to be raised as the electromagnet was too weak at 9 volts and could not attract the bolt from longer distances. After adding several battery holders I found that 12 volts were the optimal voltage to attract the bolt from the needed distance.
Here i present the final locking mechanism and how it works. Overall it seems i overcomplicated things and created a sort of useless machine. Something far too complicated to carry out a much simpler task.
We have been learning how to program machine learning using tensors. In this poster we present an example of machine learning in a real life situation. For my poster I decided to present a program used to identify melanomas which can cause skin cancer.
Machine learning is when a program uses mathematical models to learn things and improve itself. For this assignment, we were tasked with creating a machine learning model that would identify varying objects using prior knowledge and segments of code from previous assignments. For my model, I created a program that would identify four shapes, a cylinder, cube, star, and pyramid. I produced these models using tinkerCAD and the school's 3d printers.
To gather our data we used a program that would interface with the school computer's cameras and rapidly take low-quality pictures. We ended up with 200 pictures of each shape in a grayscale 48 by 48 pixel format. This was uploaded into google drive as our dataset
This is my model which identifies different shapes, it uses the above greyscale images and a machine learning model to improve it's detection of different shapes.
This is the dataset used in the program, each folder holds 200 of the used pictures. The name of the folder is the true label in this instance which is called upon later.
The first layer is the data layer containing the training tensors named data. The second layer of this model is a dense input layer with a sigmoid activation code. The third layer is a dense layer with a softmax activation code which is the output. The first code retrieves the program's data and then the sigmoid function produces a value that is 1 or 0, essentially yes or no, telling the program whether its labeling was correct. The sigmoid function allows for generalization and for the program to make accurate guesses in the future as to what the object's label is.
These predictions are correct as the prediction matches up with the true label. The true label is the assigned label in the data set which can be pulled for reference against the prediction in order to calculate its accuracy.
These pictures are predicted incorrectly as the prediction does not match up with the label. It seems the program has a problem distinguishing pyramids, most likely from the angles the pictures were taken from. This would easily be fixed by providing more or better pictures of the pyramid