12.5 Implementation
Fabrication and Assembly
The physical prototype was constructed using laser cut wood as it was most resistant to bending. As well, 3D printed parts were created as they needed to hold a specific form while adhering to height specifications. The assembly was then attached utilizing bearings and fasteners to reduce friction at the joints and improve the repeatability of the motion.
Using trial-and-error as well as frequent testing, spacer widths and fastener tightness was adjusted to control friction between the moving links. The assembly consisted of figuring out geometric constraints so the driven final link did not reach a completely horizontal state as this would create force horizontally and restrict vertical motion for the motor. The bottom platform dimensions were decided based on how far the linkages could move and where the motors would be placed.
The above parts shown in Figures 1, 2, and 3 are the CAD models of the 3D printed aspects of our design. Figure 1 displays the two types of rod guides with the left-most one holding the rods that drive the motion in place with a linear bearing in them to allow rotation. On the right, the support is used for the rods holding the linear bearings to constrain our project to move in a straight line. These were designed so the height would not interfere with linkage movement. Figure 2 is the linear bearing attachment that is used for both horizontal and vertical movement and allows for the bearing to slide along a rod while attached to the linkage system. Finally, Figure 3 is a specially designed part that allows for the tilting aspect of the mechanism to function properly. This holds the top platform while rotating with it so that it does not fall and movement is not choppy.
Electronics
For the electronics and circuitry aspect of the circuit we used a 9-Volt battery, 12-Volt motor, 4 buttons, a motor controller, a breadboard, and an Arduino to power the mechanism and control movement. Figure 4 displays a wiring diagram of our circuit that shows all inputs and outputs and Figure 5 shows the motor setup on our final prototype.
To house the wires of our circuit, we attached our breadboard, motor controller, batter, and Arduino onto the top platform that would hold our IPad. This ensures that wires were out of the way and could not be accidentally unplugged by the user. The wire management can be seen above in Figure 6.
Software Development
The Arduino was used to control how each of the 4 buttons functioned. 2 buttons controlled the upward motion of each side and the other 2 controlled the downward motion of each respective side.
The code consists of if-else statements that read whether or not a button is being pressed. If the button is pressed, the motor moves in the intended direction depending on upward or downward motion. Below is the complete Arduino code that was used in order to operate the mechanism:
const int buttonPin = 2; // the number of the pushbutton pin
// variables will change:
int buttonState = 0; // variable for reading the pushbutton status
#define enA 11
#define in1 12
#define in2 13
#define in3 9
#define in4 8
#define enB 10
void setup() {
// initialize the LED pin as an output:
Serial.begin(9600);
pinMode(enA, OUTPUT);
pinMode(in1, OUTPUT);
pinMode(in2, OUTPUT);
pinMode(enB, OUTPUT);
pinMode(in3, OUTPUT);
pinMode(in4, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
}
void loop() {
// read the state of the pushbutton value:
float voltageFU = analogRead(A1) * (5.0 / 1023.0);
float voltageFD = analogRead(A3) * (5.0 / 1023.0);
float voltageBU = analogRead(A0) * (5.0 / 1023.0);
float voltageBD = analogRead(A4) * (5.0 / 1023.0);
Serial.println(voltageFU);
// check if the pushbutton is pressed. If it is, the buttonState is HIGH:
if (voltageFU == 5.0 && voltageFD != 5.0 && voltageBU!= 5.0 && voltageBD!= 5.0) {
// turn LED on:
digitalWrite(in1, LOW);
digitalWrite(in2, HIGH);
analogWrite(enA, 255);
} else if (voltageFD == 5.0 && voltageFU != 5.0 && voltageBU!= 5.0 && voltageBD!= 5.0){
digitalWrite(in1, HIGH);
digitalWrite(in2, LOW);
analogWrite(enA, 255);
} else if(voltageBU == 5.0 && voltageFD != 5.0 && voltageFU != 5.0 && voltageBD!= 5.0){
digitalWrite(in3, LOW);
digitalWrite(in4, HIGH);
analogWrite(enB, 200);
} else if(voltageBD== 5.0 && voltageBU != 5.0 && voltageFD != 5.0 && voltageFU != 5.0){
digitalWrite(in3, HIGH);
digitalWrite(in4, LOW);
analogWrite(enB, 200);
}
else {
// turn LED off:
analogWrite(enA, 0);
analogWrite(enB, 0);