Robot Arm
From ENGR005_2009
Contents |
Team Robot Arm
Our project involves using a mechanism to sense the motion of a person's arm. This mechanism will send a signal to MatLab, which will then send a signal to a robot arm, causing it to move in a similar manner.
Possible Example, not finalized
Members
Motivation
First of all, the robotic arm is really cool. We wanted use our knowledge of Matlab to design a robotic system that would mimic actual human motion. Secondly, the applications for a human controlled arm are practically endless- exoskeletons, bomb deactivation, medical applications, etc.
Planned Timeline
- 11/19
* Code version 1 (elbow control) complete
- 11/21
* Human elbow instrumentation complete
* Mechanical elbow joint and mount complete
- 11/24
* Systems integrated, elbow complete
- 12/5
* Human shoulder instrumentation for 1 D.O.F complete
* Mechanical 1 D.O.F. shoulder complete
* Code version 2 (elbow, 1 shoulder D.O.F.) complete
- 12/6
* Systems integrated, presentation-ready
Parts and Equipment Required
Mechanical Arm: Elbow:
E5 servo parts
Shoulder:
E5 servo parts
Human Instrumentation:
Elbow:
Stock materials (1/8" Al plate, 1/32" Al plate, 1/16" wall Al T-bracket, 1/2" Al rod, ass. fasteners)
Machine shop time
Linear potentiometer
Shoulder:
Stock materials (80/20? Easystruct? Al/steel square tubing? Ass. fasteners)
Machine shop time
Linear potentiometer
Actual Timeline
- 11/19
* Calibration code and servo control code complete. Calibration was done using the law of cosines.
- 11/24
* Reading the potentiometer code and translating to angle code complete. The overall code tested, most of the kinks resolved.
* The upper arm portion of the mechanical device for the potentiometer complete.
* We all met to begin design of the actual robot arm.
- 12/1
* We met and calibrated a servo motor to the potentiometer to make sure it worked properly.
* At first, we had an issue where the servo motor did not move the full rotation of the potentiometer.
* Also, we modified the Readpoten code, and amazingly got the servo motor to respond in a similar fashion to the potentiometer!
- 12/5
* The lower arm portion of the mechanical device for the potentiometer complete.
* We all came together to calibrate the our mechanical elbow mount to the actual robot arm.
* We had trouble at first due to the result of imaginary numbers as outputs from Matlab.
* This was soon discovered to be just a calibration error.
- 12/7
* All got together to complete the presentation.
Human Sensor
- Designed to hold a potentiometer over the rotation axis of the elbow
- Machined in Swarthmore machine shop from aluminum bar stock (plates), aluminum sheet goods (potentiometer bracket, made on brake), and steel square tubing and aluminum L-bracket (potentiometer interface)
Human calibration
This was done by picking two points on the mechanical mount for the shoulder and measuring the distance between them. This was done repeatedly to create a line of best fit. Then, using the law of cosines allowed matlab to measure the angle between them.
Matlab Code
Calibration
% This script takes input from the user and uses it to calibrate % a motor connected to channel 1. clear all;
s=instrfind; %Find any serial links (we can have only 1) delete(s); %... and delete.
%Create a new serial communications link s=serial('COM1','Baudrate',115200,'Terminator','CR'); fopen(s); %... and open it
disp(' '); disp('Program starting.'); disp(' '); calibValues = [zeros(2,5)]; b=input('Enter leg1 length'); a=input('Enter Leg2 length'); for i=1:5;
pw=input('Enter pulse width: '); % get user input
calibValues(1,i) = pw;
cmd=['#1P' num2str(round(pw)) '#2P' '1150' 'T250'];
fprintf(s,cmd);
disp(['cmd = ' cmd]); disp(' ');
position = input('Enter Distance ');
calibValues(2,i) = acos((b^2 + a^2 - (position)^2)/(2*a*b));
end;
y = polyfit(calibValues(1,:),calibValues(2,:),1);
calibEnd = [y(1), y(2)];
save('CalibrationMatrix','calibEnd'); disp(' '); disp('Program ending.');
humancalibration
s=instrfind; %Find any serial links (we can have only 1) delete(s); %... and delete.
%Create a new serial communications link - don't worry about details, %ask professor Cheever if you would like details. s=serial('COM1','Baudrate',115200,'Terminator','CR'); fopen(s); %... and open it
b=input('Enter leg length : ');
calibValues = [zeros(2,5)];
for i=1:5
dist=input('Enter distance : ');
calibValuesArm(2,i)= acos((2*b^2 - (dist)^2)/(2*b^2));
fprintf(s,'VC'); %Inquire from connection "C"
rtKnob=fread(s,1); %Read potentiometer value.
calibValuesArm(1,i)=rtKnob;
end
m = polyfit(calibValuesArm(1,:),calibValuesArm(2,:),1);
calibEndArm = [m(1), m(2)];
save('CalibrationMatrixArm','calibEndArm'); disp(' '); disp('Program ending.');
Readpoten
s=instrfind; %Find any serial links (we can have only 1) delete(s); %... and delete.
%Create a new serial communications link - don't worry about details, %ask professor Cheever if you would like details. s=serial('COM1','Baudrate',115200,'Terminator','CR'); fopen(s); %... and open it
load CalibrationMatrix.mat; load CalibrationMatrixArm.mat;
loopTm=100; %Amount of time we will be looping. startTm=clock(); while etime(clock(),startTm)<loopTm,
%Don't worry about details of next four lines. Talk to professor
%Cheever if you would like to know more.
fprintf(s,'VC'); %Inquire from connection "C"
rtKnob=fread(s,1); %Read potentiometer value.
%[rtKnob]%Put values in display solely to be displayed.
%theta = ((rtKnob - calibEndArm(1,2))/(calibEndArm(1,1)));
theta = calibEndArm(1,1)*rtKnob + calibEndArm(1,2);
time = .01;
pw = ((theta - calibEnd(1,2))/(calibEnd(1,1)));
cmd=strcat('#1P',num2str(pw),'T',num2str(time));
fprintf(s,cmd);
%pause(0.01); %Wait just a short time.
end %The loop ends here.
beep; %Signify that we are done.
Conclusions
Although we did not get as far as creating the shoulder, our project successfully meets the original goal of creating a mechanical robotic system that perfectly mimics the motion of a human elbow. Using a linear potentiometer secured within a mount that can be attached to a human arm allowed to accurately collect data representing the motion of the arm about the elbow. This data was successfully transmitted to Matlab, which sent a signal to our robot arm. We had success in having the robot mimic both the motion up and down, and the speed of this motion.
