Stage Two: Week Commencing 21.10.2013
Week (02)
Description:
The Aim of this session is to complete the mouth mechanism and test its
durability.
Parts
Completed Upper and Lower Jaw from Stage 1
2 x straight Meccano Bracket
Phase 2.
To attach the upper and lower jaw to the ‘Pan and tilt’
brackets on the servo a straight metal Meccano bracket was attached to the two
L brackets on the corners on both the upper and lower jaw with nuts and bolts.
The open source ‘Sweeping servo code was used from
Arduino.cc.
Example: (http://arduino.cc/en/Tutorial/sweep)
// Sweep
// This example code is in the public domain.
#include
<Servo.h>
Servo
myservo; // create servo object to control a servo
// a maximum of eight servo
objects can be created
int
pos = 0; // variable to store the servo position
void
setup()
{
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}
void
loop()
{
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>=1; 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
}
}
However since I am using a Sensor shield (V4) –
(2.1) the code has to be altered slightly to allow me to output to Analog
ports on the shield.
#include <Servo.h>
long rfac;
long mpos;
Servo myservo;
// create servo object to control a servo
// a maximum of eight servo objects can be created
long p=180;
//Starting Pos
void setup()
{
Serial.begin(9600);
pinMode(A0,OUTPUT); //Output to analog (A0)
myservo.attach(A0); // attaches
the servo on pin A0 to the servo object
}
void loop(){
myservo.write(p);
//Write Pos
delay(100);
//Adds a delay of 100 milliseconds
p=p+70; //
Sweeps position + inclination of 70
Serial.println(p); // prints pos in viewer
}
Using this code I can test the starting and finishing
position of the servo arm, this will give me a set of co-ordinates to work
within and also help reduce stress on the gears of the servo. Using the
sweeping method tests the durability of the build and also the torque and speed
capabilities of the metal-geared servo. ( 2.2, ‘Video’)
Feelings:
I feel pleased with how the parts have come together
and the successes of the initial testing, but I am disheartened having to alter
the build to include additional elements I feel I have to backtrack slightly
and look at a new approach for the jaw mechanism.
Evaluation:
A key positive element of this session was that when
the jaw components where positioned into place they fitted perfectly and looked
aesthetically correct. However I feel that there may be future issues regarding
the amount of torque placed on the Milliput from the servo (8kg) and also that
a simple up and down movement for the jaw might not look as realistic as I initially
envisaged. A possible second servo to control left and right jaw movement may
be required to give the jaw a swinging action.
Analysis
The current situation of the build may have to be
altered to make it more realistic and give more fluidity when it comes to
matching it with audio output. It would make sense to scrap the original plans
for the jaw mechanism and start over again implementing a second servo. However
the adapted ‘Sweeping Servo’ code can be changed to add an additional servo
into another Analog port to control the left and right movement of the jaw.
Conclusion
In conclusion I think I have done a lot of work on the
project this week however I feel that a lot of time has been wasted due to poor
planning concerning the un-natural behaviour of the jaw movement.
Action Plan
I will draw up a new sketch and incorporate a second
servo into the plans to give me the left and right jaw movement, I will also
adopt a more comprehensive approach to designing future frameworks of specific
elements in order to help time management.
1.1









