Thursday, December 12, 2013

Ramp Design

       Here's the design of the ramp in two different styles: 3D printed style and 2D laser cut style. The two dimensional laser cut piece needed to be designed due to time issues with the 3D printer. The downfalls of the 2D part are there are less features, more parts and a permanent thickness to the pieces. Both pieces are under the 4 cubic inch requirement (around 1.8 to 2.5 inches squared respectively). 


 3D Ramp style (1 piece)


2D style piece (3 pieces)

Final Build Product

Here's some images showing the final build. The 3D printed ramp of the lift is still missing because time ran out but a piece of cardboard holds it's place. We're running two Arduino boards one is just supplying 5 volts to both servos and the other one has all the code and buttons on it



 Side View



Top View
 

 Top View


 Side view with cardboard ramp

Finalized code

Here's the finalized code that contains an LCD screen, 2 potentiometers, and a button.



 
// Code create by mark aruda for Mecanical Design Lab 1 at Umass Lowell
// Code moves 2 servos, the first moves based on the potentiometer value,
//the second servo moves between horizontal and vertical based on a pushbutton
//button attatched to 1
//potentiometer attatched to A3
//Servo 1 attatched to 9
//Servo 2 attatched to 10
//LCD attatched to 12, 11, 5, 4, 3, 2 http://www.arduino.cc/en/Tutorial/LiquidCrystal
//LCD RS pin to digital pin 12
//LCD Enable pin to digital pin 11
//LCD D4 pin to digital pin 5
//LCD D5 pin to digital pin 4
//LCD D6 pin to digital pin 3
//LCD D7 pin to digital pin 2
#include <Servo.h> //includes servo library
#include <LiquidCrystal.h>// include LCD display
Servo servo1; //servo control object
Servo servo2;
LiquidCrystal lcd(12,11,5,4,3,2);//sets up the LCD display array to those pins
const int buttonPin = 7; //labels button pin
const int potpin = A3; //labels analog read pin for potentiometer
int potposition; //creates value for potientiometer value
int servo1position; //creates variable for servo position
int servo1clockwiseSpeed = 100; //the speed to make the continuous servo go up
int servo1counterclockwiseSpeed = 80; //the speed to make the continuous servo go down
int servo1stop=90; //the adjusted servo position to make the servo stop
boolean currentState = LOW; //used for debounce code
boolean lastState = LOW;
boolean stateChange = false;
int currentButton = 0;// used for button count
int lastButton = 1;
// setup
void setup() {
lcd.begin(16,2); //to set the LCD to start with 16 coloums and 2 rows
servo1.attach(9); //servo1 attached pin 9
servo2.attach(10); //servo2 attached pin 10
pinMode(buttonPin, INPUT); //makes the button pin an input
lcd.clear();
}
// main loop
void loop(){
potposition= analogRead(potpin); //reads the potentiometer value and gives a value between 0-1023
servo1position= map(potposition,0,1023,0,180); //maps the value from the potentiometer so it can work for a servo range
//if the potentiometer is between 80 or 100 the servo will not move and it will print stopped on the LCD
if ( servo1position >= 80 && servo1position <=100)
{
servo1.write(servo1stop);
lcd.setCursor(0,0);
lcd.print("Stopped ");
}
//if the potentiometer is greater than 100 it will move in the positive direction and write that on the screen
if (servo1position > 100)
{
servo1.write(servo1clockwiseSpeed);
lcd.setCursor(0,0);
lcd.print("Going up ");
}
//if the potentiometer is less than 100 it will go down and write that on the LCD screen
if (servo1position <80){
servo1.write(servo1counterclockwiseSpeed);
lcd.setCursor(0,0);
lcd.print("Going down");
}
//look at various function descriptions
currentState = debounceButton();
stateChange = checkForChange(currentState, lastState);
currentButton = getButtonNumber(lastButton, currentState, stateChange);
indicatorLight(currentButton);
lastState = currentState;
lastButton = currentButton;
}
// function debounceButton to make sure the button is only pushed once
boolean debounceButton()
{
boolean firstCheck = LOW;
boolean secondCheck = LOW;
boolean current = LOW;
firstCheck = digitalRead(buttonPin);
delay(50);
if (firstCheck == secondCheck){
current = firstCheck;
}
return current;
}
// function checkForChange this function makes sure there is a change in whether the button is pushed or not
boolean checkForChange(boolean current, boolean last)
{
boolean change;
if (current != last){
change = true;
}
else {
change = false;
}
return change;
}
// function getButtonNumber means that if there is a change then the button count goes up by 1 untill it reaches 1
// then it goes back to 0
int getButtonNumber(int button, boolean state, boolean change)
{
if (change == true && state == LOW){
button++;
if (button > 1){
button = 0;
}
}
return button;
}
// function indicatorLight this function will set the servo to 90 degrees or 0 degrees according to what button it is on
void indicatorLight(int button) //function that acts according to the button number that the get button number function gives out
{
if (button==0) //if the button is 0 it makes the servo go to 90 degrees
{
servo2.write(20);
lcd.setCursor(0,1);
lcd.print("Lever up ");
}
if (button ==1) // if the button number is 1 it makes the servo go to 180 degrees
{ // if the button number is 1 it makes the servo go to 180 degrees
servo2.write(90);
lcd.setCursor(0,1);
lcd.print("Lever Down");
}
}
view raw gistfile1.txt hosted with ❤ by GitHub
The LCD screen is having some problems but it should be fine by tomorrows presentation.

Here's the wire diagram setup.

This was created using the Fritzing program.

Monday, November 25, 2013

Week 11/25/13 Overview

Attendance: Brandon Herrick, Patrick Andersen, Mark Aruda, Thomas McSwiggin

Dates:    11/23/13           11/25/13
Hours total: 6 hours

Description: Solid works parts to be drafted and assembly.

    First shipment of parts were delivered today still waiting for the servo motor and second shipment of Lego pieces. Some preliminary assembly can be setup, but not the majority. The solid works parts were found from some of the Lego libraries provided by Professor Sullivan.

Parts list:

Wheel Chair Lift Parts List
Quantity       Part name
6 15 hole Lego beam
2 1x4 thin lift arm
2 1x9 bent lift arm (6-4)
1 10 axle
2 8 axle
20 connector pins
4 half  bushings
2 20 tooth gear
2 1x16 hole brick
6 axle sleeves
1 8 tooth gear
6 1x3 hole brick
2 thin triangle Legos


Solid Works Parts/Files:


                                                             15 Hole Lego Beam
                                                                  Axle size 10

                                                                 1 x 9 bent Lego
                                                                     Connector Pin


                                                                      20 Tooth Gear

                                                                 1 x 16 Hole Brick
                                                                    1/2 Bushing




The assembly will be coming soon.

Thursday, November 21, 2013

Week of 11/18/13 Overview

Attendance: Brandon Herrick, Mark Aruda, Patrick Andersen, Thomas McSwiggin

Day of meetings: 11/19 and 11/20

Topics Discussed: Parts list and ordering and redesigning on the parts we have.

      The Parts that we will be using will be mostly Lego parts from select websites. Other parts like the platform and the base may need to be 3D printed.
     So far no redesigning is needed, but during the building process this will probably change. Some Solid works models were drawn up by Patrick and Brandon. Mark tidied up the code while Thomas ran the blog site and brainstormed on part ideas.

Here are some of the initial parts/ assembly created:







Code For the System

This is the initial draft of the Arduino code for the project design.
// Code create by mark aruda for Mecanical Design Lab 1 at Umass Lowell
// Code moves 2 servos, the first moves based on the potentiometer value,
//the second servo moves between horizontal and vertical based on a pushbutton
#include <Servo.h> //includes servo library
Servo servo1; //servo control object
Servo servo2;
const int buttonPin = 2; //labels button pin
const int potpin = A3; //labels analog read pin for potentiometer
int potposition; //creates value for potientiometer value
int servo1position; //creates variable for servo position
boolean currentState = LOW;
boolean lastState = LOW;
boolean stateChange = false;
int currentButton = 0;// used for button count
int lastButton = 2;
// setup
void setup() {
servo1.attach(9); //servo1 attached pin 9
servo2.attach(10); //servo2 attached pin 10
pinMode(buttonPin, INPUT); //makes the button pin an input
}
// main loop
void loop(){
potposition= analogRead(potpin); //reads the potentiometer value and gives a value between 0-1023
servo1position= map(potposition,0,1023,0,180); //maps the value from the potentiometer so it can work for a servo range
servo1.write(servo1position); //writes the servo to that value
currentState = debounceButton();
stateChange = checkForChange(currentState, lastState);
currentButton = getButtonNumber(lastButton, currentState, stateChange);
indicatorLight(currentButton);
lastState = currentState;
lastButton = currentButton;
}
// function debounceButton
boolean debounceButton()
{
boolean firstCheck = LOW;
boolean secondCheck = LOW;
boolean current = LOW;
firstCheck = digitalRead(buttonPin);
delay(50);
secondCheck = digitalRead(buttonPin);
if (firstCheck == secondCheck){
current = firstCheck;
}
return current;
}
// function checkForChange
boolean checkForChange(boolean current, boolean last)
{
boolean change;
if (current != last){
change = true;
}
else {
change = false;
}
return change;
}
// function getButtonNumber
int getButtonNumber(int button, boolean state, boolean change)
{
if (change == true && state == LOW){
button++;
if (button > 2){
button = 0;
}
Serial.println(button);
}
return button;
}
// function indicatorLight
void indicatorLight(int button) //function that acts according to the button number that the get button number function gives out
{
if (button==0){ //if the button is 0 it makes the servo go to 90 degrees
servo2.write(90);
}
if (button == 1){
//do nothing
}
if (button ==2) { // if the button number is 2 it makes the servo go to 180 degrees
servo2.write(0);
}
}
//things to add in the future lcd screen and indicator lights
view raw gistfile1.ino hosted with ❤ by GitHub
The LCD screen has yet to be added and also some extra code may be plugged in depending on the time we have.

 https://gist.github.com/maruda95/7552561

Thursday, November 14, 2013

Design summary

Group Members: Thomas McSwiggin, Brandon Herrick, Mark Aruda, Pat Anderson

Summary of this week's progress:
Our whole group met on Tuesday 11/12 to finalize our design, make a list of necessary parts, and write our code

     The project that we're working on is an elevated handicap lift that you see on most transportation busses. These lifts can span a height of 4 to 5 feet where ours will span maybe 2 to 3 inches. They're run on a two bar system that keeps the ramp level at any height. Usually this two bar system is run by hydraulics, but for our project we're using high torque servo motors. The ramp will be retractable so it will be able to fit in small spaces.

The parts that we'll be using are:

                                  2 decent servo motors that have 180 degree turning radius
                                  4 Long Lego Shafts (haven't decided size yet we'll figure that out in  drafting)
                                  2 offset Lego pieces ( Around 20 degree bend)
                                  2 brackets made from the 2D laser cut out
                                  1 platform made from 3D laser printer
                                  10 Lego connector pieces
                                  2 Different sized gears (small to big = torque ) 
                                  1 External Battery (may need to run two servos smoothly ?)
                                  (Optional):   1 Nicer potentiometer  and 1 Nicer push button 


The code outline is as follows:
         The potentiometer will control the main double arms from going up and down so one servo will need to be mapped to this and this servo will have the gears attached to it so it may not even need the full 180 degree rotation. The push button should control the ramp from going up and down so a Boolean call will be sufficient for this, the servo will probably go 90 degrees. A button de-bounce will be needed. A green and red/yellow LED will be used to indicate whether the ramp is fully down or fully up (green for go) otherwise if the ramp is not in those two positions the red/yellow LED should be lit. I'm not sure at this point if we need to use the LCD screen, but well worry about that later.

The code will be posted later on when we figure out GitHub.





A drafted picture (Figure 1) and a legitimate picture (Figure 2) can be seen below.

Figure 1. Quick sketch of design
 
Figure 2. Real version of the lift