User:Sej8926/ENES-100/project 2

Week1 Narrative
Motor 1:
 * Pros
 * 1) It is already attached to the gears
 * 2) Works with the Motor Test found from previous documentation. (Very jerky though)
 * Cons
 * 1) Does not work on Example Stepper Test (makes the gears rotate)
 * 2) Not strong enough to rotate both gears
 * 3) Very unstable/jerky

Motor 2:
 * Pros
 * 1) Very sturdy, and does not jerk
 * 2) Works with the example Stepper Test
 * Cons
 * 1) Does not have gears already attached to it
 * 2) A previous problem was the motor would heat up within 30 seconds of spinning. However, I let it run for 10 minutes straight (at 10 rpm) and the motor did not heat up, and the motor shield board only heat up slightly.
 * 3) The biggest problem was that the Motor Test from previous documentation did not work. (The motor did not spin, instead it shook)

To fix this, I messed around with the formation of the wires to see if that was the problem, and it was.

//uses Adafruit Motor shield library AF_Stepper motor(200, 2); int solenoid = 6; //set solenoid to digital pin 6 int first; int second; int third; void setup { Serial.begin(9600);   // set up Serial library at 9600 bps Serial.println("Complete test of stepper motor."); motor.setSpeed(120);   // 120 rpm // initialize the digital pin as an output pinMode(solenoid, OUTPUT); digitalWrite(solenoid, LOW); } void loop { //continue interations until lock is opened combinations; } void combinations { for (first = 1; first < 40; first++){ for (second = 1; second < 40; second++){ for (third = 1; third < 40; third++){ motor.step(first*5, FORWARD, DOUBLE); delay(250); motor.step(200, BACKWARD, DOUBLE); motor.step(second*5, BACKWARD, DOUBLE); delay(250); motor.step(third*5, FORWARD, DOUBLE); delay(250); digitalWrite(solenoid, HIGH);  // turn the solenoid on (HIGH is the voltage level) delay(20);                    // wait for a 0.02 seconds digitalWrite(solenoid, LOW);   // turn the solenoid off by making the voltage LOW delay(100);                    // wait for a tenth of a second Serial.print("Combination attempted is "); Serial.print(first); Serial.print(", "); Serial.print(second); Serial.print(", "); Serial.print(third); Serial.print("."); //finish with three full forward rotations motor.step(600,FORWARD, DOUBLE); delay(1000); }    }  } }
 * 1) include 

Now the only problem with motor 2 is that the gears are not attached. This is the next step, and once that is done then it should be running smoothly.


 * 10/10/20 .. very good .. good documentation ... don't need to copy the arduino code here ... it is an unmodified example right? Just mention it's name. --1sfoerster (discuss • contribs) 14:07, 18 March 2014 (UTC)

Week2 Narrative
I found that the problem was that there is not enough power to supply the current to give the gear more torque. To do this I switched the original Motor Shield v1.2 to the Motor Shield v2. I had to download the new [|Adafruit Motor Shield v2 library] There had to be changes done to the original motor code because the motor library uses different functions, so I had to map the v1.2 library in the v2 library.

//uses Adafruit Motor shield library
 * 1) include 
 * 2) include 


 * 1) include 

Adafruit_MotorShield AFMS = Adafruit_MotorShield;

//AF_Stepper motor(200, 2); Adafruit_StepperMotor *motor = AFMS.getStepper(200,2); int solenoid = 6; //set solenoid to digital pin 6 int first; int second; int third; void setup { Serial.begin(9600);   // set up Serial library at 9600 bps Serial.println("Complete test of stepper motor."); AFMS.begin;           // create with default frequency 1.6 kHz motor->setSpeed(120);   // 120 rpm // initialize the digital pin as an output pinMode(solenoid, OUTPUT); digitalWrite(solenoid, LOW); } void loop { //continue interations until lock is opened combinations; } void combinations { for (first = 1; first < 40; first++){ for (second = 1; second < 40; second++){ for (third = 1; third < 40; third++){ motor->step(first*5, FORWARD, DOUBLE); delay(250); motor->step(200, BACKWARD, DOUBLE); motor->step(second*5, BACKWARD, DOUBLE); delay(250); motor->step(third*5, FORWARD, DOUBLE); delay(250); digitalWrite(solenoid, HIGH);  // turn the solenoid on (HIGH is the voltage level) delay(20);                    // wait for a 0.02 seconds digitalWrite(solenoid, LOW);   // turn the solenoid off by making the voltage LOW delay(100);                    // wait for a tenth of a second Serial.print("Combination attempted is "); Serial.print(first); Serial.print(", "); Serial.print(second); Serial.print(", "); Serial.print(third); Serial.print("."); //finish with three full forward rotations motor->step(600,FORWARD, DOUBLE); delay(1000); }    }  } }

I proceeded to test out the new code on the first motor, however the yellow gear would only shake, even if there was no pressure added to it. I tried all the different wiring combinations, however none of them worked. Then I decided to test it out on the second motor, and it worked perfectly. Also, when pressure was added to it, it did not stop spinning and shake; it kept spinning. [| Video of the gear working] Now the next step is to replace the original motor with the second new motor.


 * Wow ... 10/10/40 .. very good ... --1sfoerster (discuss • contribs) 22:27, 25 March 2014 (UTC)

Week3 Narrative
A video on youtube worked at finding the combination of an unknown Master Lock. This is an outline of that video.

Step 1 While holding the latch up, spin the combination dial counter-clockwise. The dial should get stuck on twelve different numbers as you spin it. Record these numbers down. Take the 5 whole numbers. 4 of them should end in the same digit. The one that is different is the last digit of the 3 digit combination.

This narrowed it down to 100 different combinations. Tried each until found the combination: 23-29-11.
 * 10/10/0 ... outline of a video ... did you get it to work in the real world? --1sfoerster (discuss • contribs) 14:13, 1 April 2014 (UTC)
 * Verbal conversations should not be necessary to understand what happened ... regrading to 10/10/10 --1sfoerster (discuss • contribs) 12:19, 4 April 2014 (UTC)

Week4 Narrative
The next step is to write the full code to have the Combo Lock device go through all possible combinations. Below is a broken down version of each section that needs to be added to the code.


 * Use the gallery tag ... excellent! perfect ... now we can have a conversation about what is next ... what software did you use to draw this? ... what is next ??? 10/10/40 --1sfoerster (discuss • contribs) 15:36, 8 April 2014 (UTC)