A1

ENGR 17
Assignment 1
Due: Next Tuesday
type “diary on” to begin logging your matlab commands
1)
Use Matlab to solve for the unknowns using the law of sines or cosines:
a)
b)
2) A two piece robot arm with L1 = L2 = 10 units uses angular values (Q1, Q2) to position its hand.
Your goal is to find the value of Q1 and Q2 that locates the hand at (x,y) = (-3,4)
Hints—In tackling this problem consider the following:
a) What are the formulas for locating the x and y position of the elbow?
b) What is the angle of the “forearm” relative to the x axis?
c) Note that if the elbow were moved to the origin, the formula for locating the hand, if we
know the answer to (b), is the same as the answer to (a).
d) Use the three previous hints to derive the formula to compute the x and y position of the
hand given angles Q1 and Q2.
e) Use the following TEST CASES to check your formula in Matlab:
a. Q1=pi/2, Q2=pi/2 ==> x= -10, y=+10
b. Q1=pi/6, Q2=2pi/3 ==> x=0, y=10
f) Now that you’ve determined the answer to (d) you can proceed to the main problem along
one of two paths:
a. Use matlab’s “Trial and Error” capability to guess and refine your guess to get the
right angles Q1, Q2 that move the hand to within (.1, .1) of the target. Guessing is
sometimes the quickest way to arrive at an answer!!
b. Draw a picture and use the law of sines and/or the law of cosines and/or any other
trig know-how you possess, to determine angles Q1 and Q1 precisely. Use matlab
to derive the final value for x and y.
3) Suppose for the robot the angle Q1 changes slowly from 0 to pi. At the same time, angle Q2
changes from +pi to 0. Use your skill with Matlab vectors (and your previous work) to develop
the trajectory or track of the hand during this motion. Use vectors of at least 100 points to do
this. First create vectors for Q1 and Q2, then calculate the vector of x values, and the vector of y
values using your formulas from part 2d).
4) You can plot your result using the command plot(x,y)
when finished, type “diary off”, open the diary file and copy into Word. Delete any false starts. Number
your answers for which problem they solve. Then copy and paste the figure from step 4 at the bottom.
Then save your file and upload it to the HOMEWORK UPLOADER link on the class website.