61
ME350 W15 Semester DESIGN REPORT #3 Team 06 Trent Balogh Nan Li Ryan Tepper Bo Tian GSI: Stephanie Singer “We have fully abided by the University of Michigan College of Engineering Honor Code” ____________________________ ____________________________ ____________________________ ____________________________ Section 1: Project Introduction Introduce the project. Some questions you want to answer are: What is the motivation for the project? What is the environment that the mechanism must work in? What are the hard (i.e.

Automated Laser Reflection Report

  • Upload
    nan-li

  • View
    176

  • Download
    2

Embed Size (px)

Citation preview

Page 1: Automated Laser Reflection Report

ME350

W15 Semester

DESIGN REPORT #3

Team 06

Trent Balogh

Nan Li

Ryan Tepper

Bo Tian

GSI: Stephanie Singer

“We have fully abided by the University of Michigan College of Engineering Honor

Code”

____________________________

____________________________

____________________________

____________________________

Section 1: Project Introduction

Introduce the project. Some questions you want to answer are: What is the motivation for the

project? What is the environment that the mechanism must work in? What are the hard (i.e.

Page 2: Automated Laser Reflection Report

project metrics) and soft (i.e. craftsmanship, safety, etc.) specifications that are used to

distinguish performance of mechanisms? What are some of the restrictions in design? Be sure

to include pictures (within the text) to help in descriptions and reader understanding.

_____________________________________________________

In order to utilize and to reinforce the knowledge learned in this class, as well as to take a realistic

experience in model-based design, our team is going to design, build, and test a powered mechanism.

This mechanism will intercept incoming laser beams and reflect them onto a target using a movable

mirror. A laser beam can be shot along any one of several lanes, and we will develop a device to detect

which lane the laser is coming from and to move the mirror to the desired position and orientation quickly

enough to reflect the laser signal onto a target sensor.

The environment that the mechanism must work in is the playing field (Figure 1). The playing field is

defined by some restrictions in the following approximate dimensions. There are four lanes spaced 1.5

inches apart and the center of the laser is located 0.75” above the base of the arena. Lasers are shot one

at a time along the lanes in a random order. The mechanism will be attached to the mounting holes for

3/8-16 screws at the bottom of the playing field. (Figure 2)

Figure 1: Isometric View of the Playing Field

Page 3: Automated Laser Reflection Report

Figure 2 : Top View of Playing Field with Approximate Dimensions.

There are also some constraints in mechanism components. For instance, as the only part of the

mechanism that reflects the lasers, the mirror is provided with the dimensions of 25.4 mm x 51 mm x 6

mm thick. Two limit switches are also provided to calibrate the limits of the mechanism’s range of motion.

Moreover, all motion of the mechanism must be driven by one DC permanent magnet motor called Pololu

electric motor, model #1442, and the motor will run at 9V. To limit the torque and speed of the motor, the

motor cannot be connected to voltages higher than 9V.

There are some hard specifications in the design. For instance, the tests of the performance of the

machine will be judged based on 5 specifications, described in detail below and organized in Table 1

below.

Page 4: Automated Laser Reflection Report

Table 1: Laser Project Design Specifications

Additionally, the soft specifications are also defined in the craftsmanship. When making the system, we

need to make sure the mechanism has all sharp edges filed so there are no burrs in order to be safe. We

should well align the device and minimize the play between parts. The device should be well-designed

and assembled as well as well-machined with a good surface finish. We also need to make our system

look professional by making it aesthetically pleasing. Finally, when we use spacers, we should use a

single piece of material that we have machined to the proper dimensions.

Page 5: Automated Laser Reflection Report

Section 2

In order to generate individual designs of our mechanism, we used the CAD program

SolidWorks. After dimensioning the arena, drawing lines to represent the lasers, and specifying

the origin of the sketch as the laser target, we used multiple sketch relations between links to

make a two-dimensional model of our mechanism.

First, we made sure the length of the coupler was the same at all four lane positions. We

did this in order to simulate the mirror at the four positions. Next, we made the lengths of the

input links at all four positions the same. We did the same process for the output links as well.

Now that the coupler length was the same at all four positions, as well as the input link

length and output link length, we made the midpoint of the coupler at all four positions,

coincident with the lines representing the lasers. We did this in order to ensure the laser reflects

off the middle of the mirror at all of the lane positions.

Next, we drew lines from the midpoint of the coupler at the four positions to the center of

the target; these lines are the path of the reflected laser. Lines were then drawn from the center

of the target to points on the lane path for all for positions; these are the lines to be bisected.

We then made lines from the midpoint of the coupler, to the middle of the line to be

bisected. This is known as the bisector line. After adding perpendicular relationships between

the line to be bisected and the bisector line, we know from geometry that the lengths of the

bisected lines will be equal.

Finally, we added a perpendicular relationship between the coupler and the bisector,

ensuring that the coupler would be parallel to the line to be bisected(Figure 3).

Figure 3: Final 2-D model with all sketch relations

Page 6: Automated Laser Reflection Report

After making all the proper sketch relations so our mechanism fit the design

requirements, we moved the ground pivots around in order to see different possible linkage

designs. Our goal was to minimize the transmission angle deviation from 90º, while

simultaneously minimizing the space the mechanism takes up on the arena.

.

Section 3: Design Selection.

To pick up the best design from each of our individual’s, we first collected the data from each

design (Table 1), and then created a Pugh Chart to help us analyzing data.

Design 1 Design 2 Design 3 Design 4

Power

Consumption

(lb-in/s )

1 3.2 20.5 10.2

Volume

(in^3)

3.56 1.42 5 4

Angle Deviation

(degree)

6.4, 11.9, 28.2,

43.7

9, 16.57, 36.8,

40.7

3.45, 16.57,

35.41, 54.61

9.26, 13.24,

44.21, 59.56

Table 1: Summary of the individual data

After a series of discussion, we created the Pugh Chart and choose power consumption, volume,

transmission angel deviation and aesthetics as our four criteria (Table 2).

Weight Design 1 Design 2 Design 3 Design 3

Power

Consumption

4 4 3 1 2

Volume 3 3 4 1 2

Angel deviation 2 4 3 2 1

Aesthetically

Pleasing

1 1 1 1 1

Sum 34 31 12 17

Table 2: Pugh Chart

Page 7: Automated Laser Reflection Report

Since the power consumption can determine how big our torque is, as well as angular velocity,

we assigned it as the most important criteria that weighs the most (4 points). To have the biggest

torque as well as the velocity, we want the power consumption of the design to be as small as

possible. After comparing with each design, we assigned Design 1 the most points of four for

smallest power consumption, and Design 3 the least points of one for most power consumption.

Since each design is using the same materials, we considered volume as the second important

criteria to determine the best design because it’s proportional to mass, which determine the

moment of inertia as well as the friction of our design.

Moment of inertia, depending on the amount and distribution of its mass, determines the torque

needed for a desired angular acceleration about the axis of rotation. More mass will lead big

moment of inertia and low angular acceleration driven by the given torque. Similarly, the design

with more mass will cause larger friction, the force resisting the relative motion of solid surfaces,

and lower the velocity and acceleration as well.

So, in order to have the largest angular acceleration, we want the volume of the design to be as

small as possible. After comparing with each design, we assigned Design 2 the most points of

four for smallest volume and Design 3 the least points of one for biggest volume.

We then considered the transmission angle, defined as the angle between the coupler and output

link for a four-bar-linkage, as the next criteria. The transmission angle is a measure of how

effective force is being transferred between the coupler and output link and the ideal value is 90

degrees. So In order to have the biggest effective force transferred, we wanted transmission angle

deviation from 90 degrees to be as small as possible. After comparing with each design, we

assigned Design 1 the most points of four for smallest transmission angle deviation and Design 4

the least points of one for biggest transmission angle deviation.

Finally, we thought the aesthetically pleasing should also be important since our design should

be well aligned and have professional look. Since each design here was made by Solid Works,

they are all well aligned and have professional look in the same level. So we assigned one point

to each of them.

By filling in the Pugh Chart and calculating the sum of each design, we worked out and picked

the Design 1 with the highest points as our best design.

Section 4: Final Linkage Design.

Table 3. Final linkage design details for reflecting the lasers into the target.

Link Lengths Ground Pivot 1 Ground Pivot 2

Input 8.089” X 5.853” 9.247”

Page 8: Automated Laser Reflection Report

Coupler 3.000” Y 15.621” 12.603”

Follower 6.278”

where X and Y are the distance toward the lasers and towards the mounting holes on the table

respectively. You can see the final design and its position on the arena in Figure 1.

Figure 1. Final Linkage Design on Arena. Locations of ground pivots in relation to the target can

be found in Table 3.

Table 4. Final 4-bar linkage design for reflecting the laser into the target keeps the transmission

angle deviation from 90° to a minimum.

Transmission Angle Transmission Angle Deviation

Lane 1 96.35° 6.35°

Lane 2 78.13° 11.87°

Lane 3 61.77° 28.23°

Lane 4 43.72° 43.72°

Figure 2. Final linkage design in position 1. Transmission angle is optimized at 90°.

Page 9: Automated Laser Reflection Report

The transmission angle is defined as the angle between the coupler link and the follower link in a 4-bar linkage such as ours. As you can see, the transmission angles are all within the limits for this project (30° ≤ Transmission Angle ≤ 150°).

For the final design, provide tables of : (1) final link lengths, (2) transmission angle for all four

lane positions, (3) transmission angle deviation for all four lane positions, and (4) ground pivot

locations relative to mounting holes on the Arena. Compare the maximum transmission angle

deviation with the limits set by the project. Be sure to include pictures (within the text) to help in

descriptions and reader understanding.

Section 5 : Final Team CAD.

We then modeled the design agreed upon in SolidWorks, along with connectors and mounting

points to attach the linkage together and fix it on the arena. We decided on the use of aluminum

as our primary material for the links, and connections using steel shoulder bolts, washers, and

dowel pins, along with bronze Oilite bushings. The total volume of the links is 3.56 in3, giving

them a combined weight of around 5.5 oz.

Figures 3 and 4. Final linkage design is constrained to a limited range of motion by a hard stop

on the mounting plate.

Page 10: Automated Laser Reflection Report

Figure 5. Linkage mounted on playing field in starting position (reflecting Lane 4 laser).

To connect our linkage together and reduce friction between the links, our group has decided to

use a combination of bushings, precisely-ground shoulder bolts, and washers. Using the shoulder

bolt and bushing combination allows us to control the fit between these components more

precisely than traditional machining. This reduces friction between links, allowing for increased

performance of the system. In Figures 6 and 7 below, you can see a cross-section of the links at

these connection points.

Figures 6 and 7. Connection of links together using shoulder bolts, washers, bushings and nuts.

Page 11: Automated Laser Reflection Report

Our design fits comfortably on the arena, and the long link lengths allow it to rotate through its

range of motion in a small amount of angular displacement.

Figure 8. Isometric view of linkage (without mounting plate) on the laser arena.

Section 6: ADAMS Model

Page 12: Automated Laser Reflection Report

In order to simulate our linkage, we used MSC ADAMS. We wanted a triangular velocity

profile, because that would give us constant acceleration followed by constant deceleration. As

measured from our Solidworks model, the linkage must rotate through 32.9644 degrees. We

multiply this by four and divide by the amount of time it takes our linkage to traverse the

32.9644 degrees, squared. This would yield an alpha value of 131.8577. In ADAMS, we change

the acceleration profile to IF(time-0.5: -131.8577d, 131.8577d ,131.8577d). We decided to make

the run time 1 second in order to minimize the torque on the joints of our linkage. We notice

Figure 10 that the input torque spikes at t=0.5s. This is where the acceleration changes from

positive to negative, so we expect this spike in torque. We also see in Figure 11, the power

consumption abruptly switches signs at t=0.5s. This is also do to the motor having to go from

acceleration to deceleration very quickly.

Figure 9: Angular displacement vs. Time for linkage design

Page 13: Automated Laser Reflection Report

Figure 10: Torque vs. Time for our linkage

Page 14: Automated Laser Reflection Report

Section 7: Motion Generator Revision

If applicable, summarize any major changes to the Motion Generator portion of CAD model since the

Gate 1 Review with your GSI. Summarize any major changes in volume, transmission angle, and other

important metrics or features. If link lengths have changed, redo ADAMS analysis and summarize results

here. If not applicable, explain in a sentence that no changes were made.

Page 15: Automated Laser Reflection Report

Be sure to also make changes to report sections from DR1 to fix issues that were commented on by your

GSI.

After the Gate 1 review, our team decided to change the shape of the linkage in order to increase ease

of manufacturing. We made all of the rounded all of our links, instead of the hard corners we had

previously. We also decided to reduce the weights of the links by adding cutouts to them, as shown in

Figure 12. The volume of our linkage changed as well, from 3.56 in^3 to 2.148in^3. After reanalyzing our

linkage design using ADAMS, we saw the maximum torque and power consumptions both decrease, as

shown in Figures 13 and 14.

Figure 12: New linkage design

Figure 13: New power consumptions vs. time

Page 16: Automated Laser Reflection Report

Figure 14: New torque vs. time

Section 8: Evaluation of Received Designs for Manufacturing

By looking through Team 5’s overall design, we can see couple of advantages on it.

Firstly, the process that they analyzed and compared with each material’ properties and then choose the

proper material to built their design is reasonable.

By analyzing the aluminum, acrylic, nylon and acetal for coupler link, they eliminated aluminum and

acrylic because of their high frictional coefficients of 0.38 and 0.3-0.7 respectively.Then they chose

between Oil-Filled Cast Nylon and PTFE-Filled Delrin Acetal Resin by comparing a number of different

factors. Even though the acetyl has slightly better range of frictional coefficients, between 0.07 and 0.14

compared to the Oil-Filler Cast Nylon of between 0.12 and 0.15. Finally they decided to make our link out

of Oil-Filled Cast Nylon because it is easier to glue the mirror to the part.

Additionally, the hard stops will be made out of neoprene rubber because it can absorb shock without

damaging the links while providing a rigid stopping location.

Secondly, the design of both input and output linkages is delicate and reasonable. By using the 1⁄8” inch

aluminum plate, instead of the 1⁄4” inch aluminum plate that is provided, the mass as well as the volume

will be less. The mass and volume are also reduced by cutting the four square parts off from each of the

linkage. Less mass will lead less moment of inertia and higher angular acceleration driven by the given

torque. Similarly, the design with less mass will cause less friction, the force resisting the relative motion

of solid surfaces, and higher the velocity and acceleration as well.

Thirdly, since the maximum transmission angle deviation of their design is 27.97, the force transferred

between the coupler and output link is effective and efficient.

Page 17: Automated Laser Reflection Report

Then by looking their engineering drawings, we noticed that there are missing dimensions and hidden

lines in the engineering drawings.

The input link did not state the overall length and dimension of the triangles. The output link also missed

the dimension of the triangles. The drawing of hard stop, base plate, and coupler is missing the hidden

lines.

In the manufacturing plans, we found they provide the .DXF files having smaller holes size than the

actual size. Comparing with milling the holes, it will save some time to waterJet a smaller hole in the

accurate placement, and then use other methods (drilling reamer or milling) to size the hole to correct

tolerances.

The base plate is probably the more complex part to manufacture since there are multiple holes with

different sizes on it. But the design team labeled it clearly on the engineering drawing and the overall

layout will be cut out by waterjet. So it is feasible to manufacturing the base plate.

All the other major parts, including coupler, input and output link, require materials that are not provided in

the project kit and we have to wait for the design team to provide us those material, including 1" thick

Wear-Resistant Nylon for the coupler, Neoprene Rubber Tubing ¾” OD, ¼” ID for hard stop and 1/8’’ thick

aluminum plate for links and spacers. The engineering drawings for the links have a relatively

complicated shape because the design team decided to cut several triangle holes to cut down the weight.

But the dimensions are yet to be fully constrained in the engineering drawings. We have talked to them

and they have provided us new manufacturing drawings to solve this problem.

After the communication between the design team and manufacturing team, we think the overall design is

good and the manufacturing part of it is feasible. The design uses multiple tools, including band saw, mill,

lathe and extensive water jet. The craftsmanship should be satisfying as they included other processes

like ream, tap, debur. We think the main focus of this design is to cut down the weight because the design

team uses lots of materials that are lighter or thinner than what are provided in the project kit.

Section 9: Evaluation of Received Manufactured Parts

Almost all of the parts manufactured for our team had the correct dimensions and were within the

specified tolerances. The finish on all of the parts was acceptable and all holes were properly deburred.

The manufacturing team was timely in delivering our linkage parts, and we did not have to wait to

assemble our linkage. The only issue we ran into with our manufactured parts was with the

dimensioning of the slots on our input link. One of the slots cut out on the input link was not on center.

Since these slots were cut out mainly for volume and weight considerations for our linkage, we

determined this issue to not be detrimental to our linkage design. We plan on moving forward with the

input link as is, and are prepared to remanufacture the input link if needed.

Section 10: Energy Conversion Introduction

In order to move our linkage to the appropriate positions, we are using a small electric motor to input a

torque to the system. However, due to the small range of motion the linkage is required to travel

Page 18: Automated Laser Reflection Report

through, angular speed is not a priority. Even at 50 rpm, the linkage will reach its desired position in less

than half a second. The torque output from the motor would optimally be large, in order to drive the

linkage to its top angular velocity, and therefore target position, more quickly. To achieve this, a

transmission can be used to reduce the angular speed and increase the torque created by the motor.

Using a transmission also allows for easier positioning of the motor, and potentially a higher power

input to the system, depending on the dynamics of the motor.

For any transmission, one of the downsides is that the transmission will not be 100% efficient. Frictional

losses, along with other small losses in energy, decrease the power output of the motor. For this project,

one of the most important constraints on the transmission is space. Minimizing the volume of our setup

means that the smaller we can make the transmission the better, eliminating some candidates.

Additionally, for this project, we must keep track of where the linkage is at all times in order to maximize

the time the laser is hitting the target. If we have to recalibrate the linkage position after every

movement, that is not acceptable. This means that there cannot be any slippage, and a very small

amount of play in the transmission, if the position of the linkage is to be accurately measured.

Section 11: Transmission Ratio Determination

Describe the inertia matching method used to generate the transmission ratio. Explain the

validity of the method. Explain why this method is superior to other methods and justify in

terms of the project objectives. Introduce relevant equations, variables, and given values (i.e.

motor inertia). Provide table summarizing results at five positions; for each position, include (1)

transmission angle, (2) R values, (3) total inertia of the mechanism, and (4) transmission ratio.

Discuss the results.

Provide pictures of mechanism inside the useful range of motion (i.e. in between the hardstops

where your mechanism will operate). Make sure relevant distances (i.e. R1, R2, etc.) are

labeled.

The concept of inertia matching is practically used in the analysis of this system, primarily for

selection of the optimum transmission ratio based on the transmission performance between

the torque produced by the motor and the torque applied to the linkage

In this process, the start-up torque is minimized, and the performance of torque transmission is

maximized by setting the optimal balance of inertial properties between the motor and the

linkage load.

We first need to calculate the moment of inertia, angular acceleration, and Start-up torque of

motor.

Page 19: Automated Laser Reflection Report

Then taking the derivative of the start-up torque with respect to transmission ratio N, and set it

to zero

We found moment of inertia of the whole mechanism seen from the input pivot by two steps.

Firstly, for each component, find its mass moment of inertia according to its center of mass.

This step was done by “Mass Properties” function in SolidWorks.

Then, for each component, calculate its moment of inertia according to its axis of rotation. For

the input and follower links, their rotation axis are straightforward to find, which are along

their joint with ground plate. For coupler link, we found the instant center between ground and

coupler link. We drew a simple sketch on the linkage assembly as shown in the Figure 15 and

took the measurements.

Figure 15: Linkage in Position #2

Page 20: Automated Laser Reflection Report

Finally, using the parallel axis theorem and the parameter calculated above, we can get the

mass moment of inertia of the whole mechanism by the following equations.

After filled in our inertial matching workbook, we got the transmission ratio of 1:1 using the

19:1 motor.(Figure 16)

Page 21: Automated Laser Reflection Report

Figure 16: Inertial Matching Workbook

Section 12: Transmission Type Selection

Describe the systematic method to select a transmission from available options (belts, gears,

chains, etc.) One option is to use a Pugh chart or a similar method with a weighting scheme.

Provide full justification of (1) chosen selection criteria, (2) weighting scheme, and (3) values

assigned in Pugh Chart. Clearly state the type of transmission that is chosen and the actual

transmission ratio that will be used.

When choosing the Transmission method, we created the Pugh chart with a weighting scheme.

We considered gears, aluminum timing pulley, and chain sets as our reasonable options of

transmission.

Weight Aluminum

Timing Pulley

Gears Chain Sets

Page 22: Automated Laser Reflection Report

Efficient

application from

distance

3 3 1 3

Torque Transfer 2 2.5 3 3

Less Weight 1 3 1 1

Sum 17 11.5 16

Since we designed our motor to drive the linkage from a distance, we thought the transmission

method should be efficiently applicable from the distance.We considered this as the most

important criteria and we assigned it to weigh the most (3 points). The advantage of pulleys

and chain sets is that they can be used from the distance, unlike gears that cannot rotate

without providing them with interpenetrating teeth on the rims. Based on our design concept,

we assigned pulley and chain sets the most points of three for good performance using from

distance, and gears the least points of one for its disadvantage.

Secondly, in order to have most efficiency when operating the mechanism, we considered force

transfer as the second important criteria. In order to get the largest output power transferred

with the same input power by motor, we wanted the torque transferred as big as possible. Even

though normally pulleys move because of the friction between the belt and the pulley and so

can slip, we decided to utilize the aluminum timing pulley to eliminate the slide. We assigned

gears and chain sets the most points of three for good performance of force transfer, and

pulleys point five less for this resolvable problem of sliding.

Finally, we considered weight, which determines the moment of inertia as well as the friction of

our transmission system, as the third criteria. More mass will lead bigger moment of inertia and

lower acceleration driven by the given torque. Similarly, the design with more mass will cause

larger friction, the force resisting the relative motion of solid surfaces, and lower the velocity

and acceleration as well. So we want the mass be as small as possible. Since the motor will

drive the linkage from distance, if using gears we will need big gears with large diameters or

multiple sets of gears that can cause large weight. The chain sets also weigh more than the

small aluminum timing pulley whose pulley part is made of plastic. So we assigned pulleys the

most points of three for smallest weight, and gears as well as chains the least points of one for

relatively bigger weight.

After the analysis of the Pugh chart, we decided to use the two aluminum timing pulleys, one

attaching to the motor, the other attaching to the input linkage, as our transmission type with the

Page 23: Automated Laser Reflection Report

transmission ratio of one. We finally decided to use two #A6A51M042DF0606 pulleys from the

manufacturer SDP-SI, and a timing belt #A6R51M108060 also from SDP-SI.

Section 13: Final Transmission Design

To accommodate the torque input to the system, we used a timing belt and pulleys to transmit power

from the motor to the linkage. Through inertia matching, we discovered that using the 19:1 motor

provided in the project kit would require a gear ratio of exactly 1:1. Therefore, the timing pulleys used

on the motor and input link will be the same size. We decided to use two SDP/SI A6A51M042DF0606

pulleys, modifying one to be able to mount on the input link and using the other as is, which is

designed to mount on the motor being used. The modified pulley will be mounted on the input link

using two ⅛” dowel pins that would fix the pulley to the link and rigidly attach the two components. We

also decided to machine the bore of that pulley to allow a bronze oil-impregnated bushing to be pressed

into place, which could then rotate around the ground pivot. This would ensure that the torque is being

applied exactly at the ground pivot, making the power transmission more efficient.

Figure 17. Timing pulley mounted on input link in order to transfer torque to the linkage.

On the motor side of the transmission, the pulleys used have a bore size that will fit the motor and can

be locked to the motor shaft using set screws. The motor will be mounted in such a way that it will have

its position adjustable both vertically, allowing us to match its height off the base plate with the input

link pulley. It will also be adjustable horizontally, allowing us to adjust the tension in the belt manually.

This adjustability in the belt tension is a key feature in the design, since if the belt has too much slack, it

could skip teeth on the pulleys, which would cause us to lose track of the position of the mechanism.

Page 24: Automated Laser Reflection Report

Figure 18. Horizontal and vertical adjustability of motor position. Distance between pulleys is adjusted

by pivoting the motor mount and tightening the bolt into the arena.

Adding the motor doesn’t increase the width or length of the space our mechanism occupies, since it is

within the confines of the base plate. However, it does add height to the system, due to mounting the

motor vertically and allowing for adjustment of the motor. While it would be possible to fit the motor

more compactly into our design, the challenges in mounting and manufacturing were deemed too

complex to implement in the amount of time left to work on the project. The motor, when fully adjusted

will add around 3 inches of height to the system.

Figure 19. Final transmission design. Belt length oversized to show motor in approximate location.

Page 25: Automated Laser Reflection Report

Section 14: Power Analysis (1 pg)(Due with Design Report #2):

Describe why power analysis is being performed. Explain the step-by-step method used to calculate the

time of motion (Tmotion). Provide relevant equations, variables, and values that prove the power analysis

was performed correctly. Discuss assumptions in the analysis. Provide the smallest possible Tmotion if

supply voltage (Vs) is limited 9V.

Provide table that includes (1) variable, (2) value of the variable in the analysis and (3) equation used to

calculate the value.

Power analysis was performed in order to ensure our motor could move our linkage throughout

the it’s range of motion in a quick and effective manor. In order to find out how quick our motor

could move our linkage, we used the following methods. In order to calculate minimum time of

motion (Tmotion), we derive an equation for torque with respect to time. We use the following equations

in order to do this;

𝜏/ n = Tstall - K*n*𝜛max ……(1)

Since our gear ratio is 1:1 the above equation simplifies to

𝜏= Tstall - K*𝜛max ……(2)

The stall torque of the motor is 84 oz-in under 12V. The power supply we use outputs 9V. As

the stall torque operates linearly with respect to the voltage input,

Tstall = 84 * 0.75 = 63 oz-in

The motor constant, K, is the slope of the torque speed curve.

K = 84oz-in / 500rpm = 0.168oz-in/rpm

Next we must derive an equation for 𝜔max with respect to time. Since our linkage must traverse 32.9644°

and we are assuming a triangle shaped velocity profile, we know 𝜔max will occur at Tmotion/2. Therefore;

𝜔max = 32.9644°

𝑇𝑇𝑇𝑇𝑇𝑇𝑇/2…..(3)

We know the acceleration will be constant because it is the slope of 𝜔with respect to time, therefore

𝛼 = 𝑇/(𝑇𝑇𝑇𝑇𝑇𝑇𝑇/2). . . . . . (4)

From inertia matching, we were able to determine the maximum linkage inertia, IL, and the motor

inertia Im. Since we have a 1:1 gear ratio, the total inertia, I, is IL+Im. Since,

Page 26: Automated Laser Reflection Report

𝜏 = 𝑇𝑇. . . . . . (5)

After converting units and plugging in all values and equations into (2) we get the quadratic equation

63𝑇2 − 1.846𝑇− 1.04822 = 0. . . . . . (6)

After solving for t, we get the minimum Tmotion to be 0.1445 seconds. All values for variables not

discussed above are summarized in the table below.

Variable Value Used Where value came from

IL 16164.084 Inertia matching

Im 16000 Inertia matching

Section 15: Torque Transfer Analysis (1-1.5 pg)(Due with Design Report #2): Bo

Identify the two joints where torque is being transferred. Describe why torque transfer analysis is being

performed. Explain the step-by-step method used to calculate the stress in the joints. Provide relevant

equations, variables, and values that prove the torque transfer analysis was performed correctly. Discuss

assumptions in the analysis. Define failure and determine if the stresses will cause failure. Compare with

relevant material properties.

Provide pictures of the cross sectional views of both joints. Provide free body diagrams of the joints. Do

not use FEA methods. Use methods taught in ME211 and ME382.

The transmission mechanism that we decided to use on this linkage design is timing belt

pulleys. The belt connects the motor and our input link to transfer the power used to drive the

linkage. The two joints where torque is being transferred are the point where input link and

motor are connected and the ground pivot points of the input link. While driving the linkage,

torque is first provided to the belt connecting the two pulleys. It is then transferred to the input

link that drives the coupler with mirror mounted on it.

We need to analyze the torque transfer in this mechanism to be able to calculate the maximum

stress, which is essential in examining the deflection of the components and whether any parts

will yield in the operation.

Here, the first transfer occurs when the axis of the motor rotates with the pulley that is pressed

on it.

Page 27: Automated Laser Reflection Report

We know the power remains unchanged through torque transfer giving the ideal condition:

Pmotor = Ppulley

Tmotorωmotor = Tpulleyωpulley

We know ωmotor = ωpulley since they are rotating along the same axis, so Tmotor = Tpulley

From the transmission design, we know the the torque provided by the motor

T = I α

Tmax = Iωdt2 = 0.35465 Nm

From ME 211, we know the stress

σ = T r / J

J = pi r4 / 2

Tmotor = 0.35465 Nm

By calculation,

σ =8.362 MPa

The second transfers occurs at the ground pivot point of the input link. Assuming no loss during

the transfer, the same torque provided by the motor is transferred to this point by the belt. And

the timing belt then transfers the torque input link through the pulley. Here, we use two dowel

pins to transfer the torque.

Page 28: Automated Laser Reflection Report

We know that

T = F r

r is the distance from the center of the pivot point to the center of the dowel pins.

Thus,

F = 41.51N

F = σ A

Here, A is the area of the two dowel pins we are using, thus,

A = 2 * pi * r2 = 1.583 E-5 m2

σ = 2.621 MPa

Across the two points where torque transfer occur, the maximum stress would be 8.362 MPa.

Since all the stresses are the results of shear force, the main failure will occur through yield.

According to manufacturer, the shaft of the motor is made of hardened stainless steel. The

dowel pins are also made of polished steel. This material has a yield strength ranging from 200

MPa to 950 MPa, which is way beyond what is required for this application. Another material

that is extensively used in this mechanism is aluminum alloy. This material has a yield strength

of at least 40 MPa. Thus, yield would neither occur on aluminum compononets.

Page 29: Automated Laser Reflection Report

Section 16: Deflection Analysis

Deflection analysis should be performed on the power transmission joints in this case to ensure that the

transmission will not come out of alignment and fail to transmit the power from the motor to the

linkage. We can use a simple model of cantilevered or beams connected between rigid walls, and beam-

bending equations to find the amount of deflection that will occur at each joint. This assumes that

beyond the joints, there is negligible deflection in the assembly.

In the motor torque transmission joint, we can model the motor shaft as a simple cantilever beam with

a uniform load. This assumes the load from the tension in the timing belt is distributed across the motor

shaft evenly. This model then follows the following deflection equation:

𝑇 = 𝑇𝑇2(2𝑇2 + (2𝑇− 𝑇)2)/(24𝑇𝑇𝑇)

where W is load in Newtons (26 N working tension for the specified belt, or 52 N total), x is length you

are analyzing along the beam, l is total length of the beam, E is Young’s modulus (approximately 200

GPa for steel, depending on alloy and annealing, and I is moment of inertia of the beam. The deflection

will be maximized at the end of the beam.

We also can find the maximum stress in the beam using the following equation:

𝑇𝑇𝑇𝑇 = 𝑇𝑇/2

We can also use this model for the other torque-transferring joint where the pulley attaches to the input

link by means of two ⅛” dowel pins.

Because of steel’s high modulus of elasticity, we found the deflection of the motor shaft and dowel pins

to both be negligible (<0.1mm). A failure would be a deflection of more than 0.5mm, which could lead to

misalignment of the pulleys and belt, which could lead to mechanical issues.

The stress purely from the tension in the timing belt is also negligible, though additional stress from

torsional forces will increase the stress in each member. A failure in this case would be yield of the joint

connections. Permanent yield would lead to continual additional wear on the components, or even

failure if the ultimate tensile strength was exceeded. The forces for this project are relatively low

however, and therefore do not come close to the yield stress (around 250 MPa) of the steel

connections.

One note of concern in this project has been the sheet metal motor bracket. Due to a lack of moment

applied to the part of the bracket holding the motor, we feel that our design will still perform as

expected, and any deflection upward of the sheet metal caused by the tension in the belt will be

negligible or offset by the weight of the motor downwards.

Page 30: Automated Laser Reflection Report

Section 17: Safety & Motor Controls Introduction (0.25-0.5 pg)(Due with Lab

Assignment #7):

Introduce safety & motor controls in general. Some questions you want to answer are: Why are safety

features and motor controls needed? How does the quality of controls affect the outcome of important

measured quantities in the project? What sensors and electronics are used for this project?

Safety features and motor controls in a variety of applications, such as automotive systems, industrial

automation, household appliances and more, make the world safer for all of us. Safety features and

motor controls in motor operation is fundamentally important. The system depending on the

electronic control of motoring operations that needs to meet functional safety features. A motor system

designed with safety feature will have a lower level of risk from improper operation and fail. (Nan)

Since the project aims to reflect the laser beam onto the receiver as long as possible, we require fast

movement and accurate positioning. The controls make sure that the mirror is at where we want it and

it is positioned in the desired direction considering angle of incidence are different at the four positions.

With higher control quality, we can reflect the laser at a higher accuracy to allow the receiver to detect

the light signal longer. Thus, better control quality is crucial and significantly contributes to a longer

signal receiving time, which is the measured quantity of the project. (Bo)

For this project, we are using a motor that has an optical encoder mounted on it, allowing us to sense

the relative angular position that the motor has traveled. We are also using a proximity sensor. This

sensor determines if there is a physical presence near to it, allowing us to determine if our linkage is at a

certain point in its rotation, which can be used for calibration purposes. Additionally, we will use a limit

switch to determine the position of the linkage and allow us to accurately position the mirror to reflect

the laser into the target. (Trent)

Section 18: Capabilities & Limitations of Sensors (0.25-0.5 pg)(Due with Lab

Assignment #8):

Discuss the capabilities and limitations of each sensor. Briefly describe how each sensor

functions to aid the discussion. Discuss noise in readings and limitations in sensor sensitivity.

The GP2D120 IR Proximity Sensor is a optoelectronics device that responds to a physical proximity

stimulus and produces a signal for measurement or control. It has the capability to detect and measure

the physical quantity of reflected light and produce a signal relating to the distance of the object being

measured.

The analog output sensor has effective range: 4 to 30 cm, typical response time: 39 ms, typical start up

delay: 44 ms, and average current consumption: 33 mA. The span of the this sensor is 26 cm, and the

sensitivity which is the ratio of the change in the measured quantity is (2.55-1.95)V/(30-4)cm

=0.02308V/cm.(Table )

Page 31: Automated Laser Reflection Report

Electro-optical Characteristics

1/Distance vs. Voltage Output of IR Proximity Sensor

Within its span, relationship between input and output of the IR Proximity Sensor is not ideal linear, the

Non-linearity error which is around 0.016667 ( 1/ Distance).

In the lab, we found the sensor can only detect object directly in front of it. It can detect the size by

changing the reading depending on the size of the object.

Noise is disturbances to the sensor signal that reduce the repeatability of measurements. Noise is

especially important to consider when using the IR proximity sensor, since if the noise is too large, it may

lead the controller to perform undesired actions, such as turning off the motor when nothing is near the

linkage. For this reason, we need to determine a threshold value of the signal, below which will be

considered as having no close-proximity presence.

We will also be using 2 Jameco #187733 snap-action “limit” switches to calibrate the position of our

linkage relative to the encoder. These switches are single pole, single throw with a maximum current

of 5 amps and maximum DC voltage of 14 volts, and close a circuit when a lever is depressed to

activate the switch. It automatically returns to the open position when the lever is allowed to move

freely. The snap-action of the switches allows for virtually no noise in the output signal. However,

Page 32: Automated Laser Reflection Report

sensitivity of the switches is important to consider when designing, as the switches have a force and

distance required to close the circuit.

Sensor 19: Mounting Considerations & Methods:

Provide reasoning for sensor placement and provide supporting pictures. Describe sensor mounting

considerations and methods, and provide supporting pictures or illustrations. Discuss how sensor

mounting affects the volume of the mechanism or other important quantities measured for this project.

Discuss whether the chosen method is acceptable in industry.

Since the sensor is used to detect the intercept of each beam as it is coming from the different lanes,

and then turned off the motor to the desired position, we put it face the direction which the beam

coming from. Additionally, since the sensor will stop the motor in the event of an obstruction, we need

to make sure it can intercept beam directly without any other obstructions.

We firstly attempted to attach it to the base of our mechanism facing to the beam, but we then found

the hard stops may obstruct the beam. Finally we decided to attach sensor to the higher position

illustrated by the picture.

Since the sensor is not attached to the linkage and the volume of it is very small, it does not affect the

volume of our mechanism much.

Additionally, the sensor is very light and will be attached to the fixed part of our mechanism, so there

will be no movement of it and we decided to glue it to our aluminum part.

Page 33: Automated Laser Reflection Report

Section 20: Encoder Counts, IR Sensor Threshold, and Controller Gains (1-1.5 pg)(Due

with Lab Assignment #9):

Explain how values were chosen for the desired position of the encoder, the gains for the controller, and

the threshold for the IR sensor. For example, calculations, guess & check, etc. Justify the use of one

method if more than one exist. Present equations if calculations were performed. Provide step-by-step

descriptions if operations such as controller gains tuning were performed.

Organize information clearly and logically. An example table to summarize data:

Table 2: Summary of Variables in Arduino Code

Variable Name in

Arduino Sketch File

Purpose of Variable Device Calculated

Value

Actual Value Used

During Testing

desPosition1 Laser Position #1 Motor 0 133

desPosition2 Laser Position #2 Motor 37.29 98

desPosition3 Laser Position #3 Motor 73.97 54

desPosition4 Laser Position #4 Motor 111.33 13

Kp Proportional Gain Motor N/A 0.25

KI Integral Gain Motor N/A 0.05

KD Derivative Gain Motor N/A 0.003

proxSwitchThreshold

Threshold value for

proximity sensor

before stopping the

motor

Proximity

Sensor

N/A 150

In order to calculate the encoder count for each of the 4 lane positions, the number of counts per

degree of rotation for our linkage must be determined. We do this using the following calculation.

encoder count value = 16(4)(19)/360 = 3.378 counts/degree.

We then multiply this value by the number of degrees our linkage travels from position 1 to lanes 2,3,or

4. The following table shows these values.

Page 34: Automated Laser Reflection Report

Table 3

Linkage Path Degrees of travel Encoder count

1 ---> 2 11.04 11.04(3.378) = 37.29

1 ---> 3 21.9 21.9(3.378) = 73.97

1 ---> 4 32.96 32.96(3.378) = 111.33

In order to be as accurate as possible, the degrees of travel were measured using our Solidworks sketch

of the linkage assembly. In order to determine the proxSwitchThreshold, we used a guess and check

method. One team member would hold a piece of paper neat a pinch point. We would then adjust the

value of proxSwitchThreshold until the motor stopped.

Section 21: Arduino Code Changes:

Discuss changes made to the Arduino code, why, and how the changes were determined. Provide clear

references to your code and/or the original code if necessary.

Since we put our limit switch after lane 4, we decided to initialize the encoder count to zero at this

point. Therefore, out lane 4 encoder count would be a low value and lane 1 would have a high encoder

count.

We added a few variables to the code; const int DES_POSITION_1b,2b,3b, and 4b and the int

previouslane which is initialized to 0. Each of these values are the encoder count values for the linkage

when the system is going backwards (i.e. 3-->2, 4-->1, etc.). From the serial monitor in Arduino, we

noticed that the encoder values were different when the linkage was traveling backwards. We think this

is most likely due to hysteresis.

Page 35: Automated Laser Reflection Report

The next variable we added was the boolean iscalibrated, which was initialized as false. This would be

used as part of our calibration code below.

Here, if the system is not calibrated, there is nothing in front of the proximity switch, and the toggle

switch is on, then we will run the calibration. Our linkage will slowly rotate clockwise until it hits the limit

switch. The system is then calibrated and the encoder count is 0 at this point.

Section 22: Final Testing Results:

Describe testing setup and processes used. Organize data from testing in a clear and logical manner.

Discuss discrepancies between results and expectations.

Before the testing started, our team used 30 minutes to set up. We mounted our mechanism to the

tables in the mechatronics lab, connected the power supply, and to adjusted the hard stop, sensors, and

variables in the Arduino code. During this set up time, we tested our mechanism with the power supply

set to 9V at which final test would be performed. Firstly we need to make sure that our mirror was

properly adjusted so that the laser reflects directly onto the center of the target sensor. Then we

checked if our threshold value for our proximity sensor was set to our desired value. Thirdly, we made

sure we had our hard stop set exactly where we want it to stop the mechanism at position 4. Fourthly,

we had our limit switches adjusted accordingly. Most importantly, we tested our encoder counts and

adjusted it for desired positions have been accurately determined by the testing arena. Then we took

Page 36: Automated Laser Reflection Report

the rest of time to clean up wiring, polish links, and carefully trim bolts to increase craftsmanship scores.

Finally before the real testing, we checked again to avoid short circuits, wiring failures, and joint failures.

After the 30-minute setup before final testing, our team moved our mechanism to the arena, where the

GSIs would test our system for the following 30 minutes. We took 5 minutes to set up on the arena.

After our linkage was securely mounted to the arena, the GSI measure our volume and transmission

angle deviation using the steel framing squares. Our mechanism is 25.4 cm in length, 12.6 cm in wide,

11.0 cm in high and the Volume is 3,520,440 mm^3. The Max Transmission Angle is 88 degree, the Min

Transmission Angle is 44 degree, and the worst Transmission Angle Deviation is 46 degree. Then the GSI

moved our linkage to a random starting position within its range of motion. Our linkage would be

required to move to contact one of the limit switches to calibrate the encoder count which we have

written calibration instructions into the controller code to achieve this function. After the initial position

was set and the linkage was calibrated, our mechanism was subjected to three trials, and in each trial

there were 40 laser beams shot randomly from lanes 1-4. All the measurements, taken using LabVIEW

and an NI-6230 DAQ Card, were based on the accuracy, speed, and repeatability of the mechanism in

reflecting the laser beams onto the target.

During the first trial, we didn’t perform well because of the wire connection problems. Our mechanism

was not stable with the reaction of the beams, and so that we only got Reflection Accuracy of 47% and

Laser Detection Percentage 31/40. We then quickly fixed the wire connections of motor and encoder

during the break. In the second trial, even though our mechanism works well, but the laser reflected by

the position 1 was always right to the target, and we only get Reflection Accuracy of 52% and Laser

Detection Percentage 34/40. Figuring out the code written must be not accurate, we adjusted our code

to increase the reflection angle of position 1. In the final trial, our points were improved to Reflection

Accuracy of 89% and Laser Detection Percentage 40/40.

Page 37: Automated Laser Reflection Report

Figure:Final Testing Results

Then we removed our linkage from the Arena, cleaned up the workstation, and left the testing area to

return the mechanism to the project storage room.

Section 23: Design Critique & Evaluation (1-1.5 pg)(Due with Final Report):

Answer all 10 questions provided below, and then go a step further to tie everything together to

demonstrate understanding of the “big picture” and overall goals of the project. Limit discussions to 1

paragraph per question maximum.

1. What worked well? What didn’t work well? Most importantly, explain why.

During the first trial, our mechanism were not stable with the reaction of the beams because of the wire

connection problems. We then quickly fixed the wire connections of motor and encoder during the

break. In the second trial, even though our mechanism works well, but the laser reflected by the

position 1 was always to the right of the target. Figuring out the code written must be not accurate, we

adjusted our code to increase the reflection angle of position 1. In the final trial, our points were

improved to Reflection Accuracy of 89% and Laser Detection Percentage 40/40 %.

2. How well did your design perform relative to your models? Explain what you think the

difference was.

Our design performed nearly as expected from the ADAMS model, though there was some loss in

performance. The model predicted a slightly faster movement than the actual mechanism. This could be

due to imperfect gains, causing the response to be slower than predicted, or the frictional forces acting

on the mechanism. Friction was not accounted for in the model in places such as in the motor and

between links, which could explain the discrepancy. The other models, such as material strength and

CAD model matched the mechanism with no failures/differences detected.

3. How did friction influence your built device?

Friction influenced our device by decreasing its performance. Even with our design trying to minimize

friction through the use of bushings and bearings, it still played a significant role in the performance of

the device.

4. How could the control algorithm (Arduino code) be improved to make better use of the

available equipment? For example, could the position be more precisely controlled? Could you

make use of a feed-forward signal? How?

Page 38: Automated Laser Reflection Report

The control algorithm could be improved by the use of a feedback system, where if the laser is not

perfectly centered on the target, it could correct the mirror position accordingly. This would require a

feedback loop where the target sensor data is fed back into the control algorithm.

5. Would there be a better way to use the sensors that were provided, or to use different

sensors, to accomplish the same objectives?

It may have been advantageous to position the limit switches in such a fashion that the mechanism

calibrated itself more frequently. However, the mechanism still performed acceptably. One

improvement could have been to obtain proximity switches to mount at each position, ensuring that the

linkage was in the correct location instead of relying on solely the encoder counts.

6. What other lessons or unique observations did you make about your device and the process

that you follow to develop it? Having completed it, would you do anything different – what

and why?

One lesson we learned when developing our mechanism is that the wiring can make or break a device.

Using the connector included on the motor, where we simply inserted the wires, did not adequately

connect them. If we had to redo it, we would solder and shrink-wrap all connections for a more

professional look. Additionally, we would like to further analyze the benefit of a smaller or larger

mechanism on performance, including response time and position error.

7. On a scale of 1-5, how would you rate the safety of your mechanism? Were the provided

sensors adequate or would additional sensors and guards be necessary?

On a scale of 1 to 5, the safety of our mechanism would be about a 4. The IR proximity sensor worked

very well shielding the mechanism from moving in the presence of foreign objects. With the threshold

set just right, it was nearly impossible to touch the pinch points. However, the attachment of our

sensors, including the IR sensor were non-permanent and would have to be fixed in place.

8. Would you recommend that we give your device to someone else right now to use and

operate? Why or why not?

We would recommend attaching the electrical components rigidly to the mechanism before giving it to

someone else for use. The largest problem was faulty connections, which could be fixed with permanent

soldered and shrink-wrapped connections. After these changes however, we would feel confident

allowing anyone to operate it.

9. What other parts and materials would have been useful to have in your design, if you had

been given them?

Additional sensors to detect the presence of the linkage at the every position would have been useful,

though not required, to ensure the linkage is in the correct position.

Page 39: Automated Laser Reflection Report

10. What would you do for a project next year in ME350?

This project seems suitable to teach students about linkages, mechatronics, transmissions, and the other

main topics of the course.

Overall, our mechanism performed as designed and met the goals we set out to achieve. Using

computer modeling and analytical models, along with design analysis techniques, we were able to

produce a mechanism that was 89% accurate at reflecting the lasers into the target, responding to all

40/40 laser bursts in testing. The mechanism exceeded performance goals, while minimizing size and

complexity for the end user. More tweaking of the Arduino parameters, and additional testing and

analysis would enable us to increase the mechanism’s performance.

Appendix A: Individual Sketch Relations Design, 3D Solidworks, and ADAMS Analysis

Trent’s Design (Design #1)

For this design, sketch relations were used to ensure the path of the light beam was modeled to leave

the laser, hit the mirror and reflect off of it with the same angle of incidence incoming and outgoing,

finally hitting the target at the end of its path. To do this, I first modeled the playing field as a sketch in

SolidWorks, and put a rough sketch of the linkage in its 4 positions. Then, using geometry and

perpendicular lines bisecting the angles, I used sketch relations to achieve the equal angles of the light

reflecting off the mirror and ensure the light will hit the target. Once these conditions were met, the

lengths of the links could be determined by dimensioning or moving the sketch of the links.

In designing the linkage, there are many factors to consider. First and foremost for this application,

transmission angle must be optimized to increase performance. The more the transmission angle is from

90°, or transmission angle deviation (TAD), the higher the torque must be to drive the linkage. Another

factor to consider in designing this linkage is weight and volume. The heavier the links, the more inertia

the motor must get moving and stop during operation. Also, a design requirement for this project was to

keep the volume of the system as small as possible. Keeping these goals in mind, I settled on the linkage

specifications found below in Figure A.1. through Figure A.3.

Figure A.1. Transmission Angles: 126.8°, 99.0°, 76.7°, 53.3°

Transmission Angle Deviations: 36.8°, 9.0°, 13.3°, 36.7°

Input Link Length = 4.194”

Output Link Length = 4.250”

Page 40: Automated Laser Reflection Report

Figure A.2. Linkage design in SolidWorks at the beginning and end of its range of motion, and isometric

view on the playing field.

Page 41: Automated Laser Reflection Report

Figure A.3. Design #1 ADAMS model helped determine torque & power needed to drive the linkage.

Page 42: Automated Laser Reflection Report

Bo’s Design (Design #2)

Page 43: Automated Laser Reflection Report

In this design, we first sketched the relations in SolidWorks to make sure that the beam of light will be

correctly reflected by the mirror to the target. All four possible passes must be covered and the two

fixed pivot points should be placed in the correct location so that the whole design and the relations are

feasible. To do this, two unspecified points were first created on the dimensioned arena. Four paths of

beam are specified and the the pivots should be equally lengthened to all the four positions. Mirrors are

placed accordingly to correctly reflect all the light beams to the target. At last, the two pivot points are

moved to an optimal location to be on the arena.

The basic ideas in designing linkages are that transmission angles satisfy the requirements to avoid

tangle position. In addition, the mirror must be able to be placed at the desired position on the linkage

to correctly reflect the beam. Also, total volume and mass must be considered so that the linkage will be

able to respond to the control effectively and rapidly. With those factors considered, I designed the

linkage that is shown in the following figures.

Figure B.1.

Transmission Angles: 93.45°, 73.43°, 54.59°, 35.39°;

Transmission Angle Deviations: 3.45°, 16.57°, 35.41°, 54.61°;

Input Link Length = 5.98”;

Output Link Length = 5.26”

Figure B.2. Linkage design in SolidWorks at the beginning and end of its range of motion, and isometric

view on the playing field.

Page 44: Automated Laser Reflection Report

Figure B.3. Design #2 ADAMS model helped determine torque & power needed to drive the linkage.

Page 45: Automated Laser Reflection Report

Nan’s Design (Design # 3)

In order to generate sketch of my mechanism, I used the CAD program SolidWorks. After

dimensioning the arena, drawing lines to represent the lasers, and specifying the origin of the sketch as

Page 46: Automated Laser Reflection Report

the laser target, we used multiple sketch relations between links to make a two-dimensional model of

my mechanism. First, I made sure the length of the coupler was the same at all four lane positions. Next,

I made the lengths of the input links at all four positions the same. I did the same process for the output

links as well. The I made the midpoint of the coupler at all four positions, coincident with the lines

representing the lasers, in order to ensure the laser reflects off the middle of the mirror at all of the lane

positions. Next, I drew lines from the midpoint of the coupler at the four positions to the center of the

target; these lines are the path of the reflected laser. Lines were then drawn from the center of the

target to points on the lane path for all for positions; these are the lines to be bisected. I then made lines

from the midpoint of the coupler, to the middle of the line to be bisected. This is known as the bisector

line. After adding perpendicular relationships between the line to be bisected and the bisector line, we

know from geometry that the lengths of the bisected lines will be equal. Finally, I added a perpendicular

relationship between the coupler and the bisector, ensuring that the coupler would be parallel to the

line to be bisected.

By creating CAD and ADAMS, I took considerations of the power consumption,

volume,transmission angle deviation, and aesthetically pleasing. Since the power consumption can

determine how big my torque is, as well as angular velocity, I want it to be as small as possible to get the

most efficiency. Since each design is using the same materials, I considered volume because it’s

proportional to mass, which determine the moment of inertia as well as the friction of my design.The

transmission angle is a measure of how effective force is being transferred between the coupler and

output link and the ideal value is 90 degrees. So In order to have the biggest effective force transferred, I

wanted transmission angle deviation from 90 degrees to be as small as possible. Finally, I thought the

aesthetically pleasing should also be important since my design should be well aligned and have

professional look.

Figure C.1.

Input link length: 10 in

Output link length: 8.29 in

Coupler length: 2 in

Transmission angle (degree): 92.62, 77.87, 64.59, 52.29

Transmission angle deviation: 37.71, 25.41, 12.13, 2.62

Page 47: Automated Laser Reflection Report

Figure C.2. Linkage design in SolidWorks at the beginning and end of its range of motion, and isometric

view on the playing field.

Page 48: Automated Laser Reflection Report

Figure C.3. Design #3 ADAMS model helped determine torque & power needed to drive the linkage.

Page 49: Automated Laser Reflection Report

Ryan’s Design (Design #4)

In order to ensure our mechanism properly reflected the laser beam to the target at each of the four

lane positions, sketch relations were used in SolidWorks. In order to do this, I first made a properly

dimensioned sketch of the playing field. I then made a sketch of the linkage and used the sketch

relations to ensure the laser beam would be properly reflected. I did this using simple geometric

relations and perpendicular bisectors to make sure the angle of incidence of the laser was the same

before and after it hit the mirror. After these relations were made, I was able to move the sketch of the

linkage around to determine link lengths, transmissions angles, and ground pivot locations.

When designing this linkage, the main point was to minimize the transmission angle deviation from 90

degrees. The greater the transmission angle deviation, the higher the torque must be to operate the

linkage. The next factor that was taken into consideration was volume and thus weight. The larger the

linkage is, the heavier it will be thus the greater inertia out linkage would have when trying to start and

stop its motion. Taking these factors into consideration, I was able to come up with design in Figure D.1

through Figure D.3

Figure D.1:

Transmission Angles (deg): 91.59, 76.18, 62.1, 48.8

Transmission Angle Deviations (deg): 1.59, 13.82, 27.9, 41.2

Input Length: 8.97in

Output Length: 7.56in

Page 50: Automated Laser Reflection Report

Figure D.2: Linkage at beginning and end of motion and isometric view

Page 51: Automated Laser Reflection Report

Figure D.3: ADAMS model of angular position, angular velocity, power, and input torque

Page 52: Automated Laser Reflection Report

Appendix B: Drawings, Manufacturing Plans, Bill of Materials, and Assembly

Plan for Final Design (Due with Design Report #1):

Shoulder Screw, 1/4" Diameter x 1/2" Shoulder, 10-24 Thread 91259A537 McMaster-Carr x 2 $0.92

SAE 841 Washer for 1/4" Shaft Diameter, 5/8" OD, 1/16" Thick 5906K5531 McMaster-Carr x 8 $1.25

Locknut, 10-24 Thread Size 90631A011 McMaster-Carr x 6 $3.27

1/4" ground and polished steel dowel pins (various lengths) McMaster-Carr x 6 $8.70

Aluminum Plate, 1/4" x 12" x 18" 9246K45 (shared) McMaster-Carr x 1 $30.39

Needle Thrust Bearing, Bore .250 4XFL8 Grainger x 6 $2.97

Total Cost: $125.93

Assembly Manual: This section should resemble an IKEA instruction set. Break the entire assembly

process into at least ten steps. Provide a written description and picture for each step. Label and

number the components in each picture.

1. Place the base plate on the arena using the dowel pins to locate it in the right position.

2. Place one washer on each pivot point

3. Place one bearing on each pivot point

4. Distinguish the input and output link and assemble the input link on the left side with the output

link on the other side using a shoulder bolt

5. Add a bearing on the shoulder bolt

6. Insert the shoulder bolt from the bottom of the input link

7. Add two washers on top of the input link

8. Add another bearing on the shoulder bolt

9. Assemble the coupler with the input link

10. Add the locknut on top of the shoulder bolt

11. Repeat process 6-11 for the output link

Page 53: Automated Laser Reflection Report

12. Mount motor onto motor bracket

13. Assemble motor bracket mount by screwing the two pieces together with 8-32 bolts

14. Attach motor bracket mount to arena using ⅜-16 bolt. Hand tighten bolt, making sure bracket

can still rotate

15. Mount motor bracket and motor assembly onto motor bracket mount, ensuring input and

output pulleys are in the same vertical plane

16. Align timing belt in both pulleys, and rotate motor bracket mount until desired tension is

achieved

17. Tighten bolt, which will fix the motor bracket mount in place and secure base plate on arena

Appendix C: Approval Packages, Bill of Materials, and Assembly Plan for

Transmission Design (Due with Design Report #2):

All drawings, manufacturing plans, and approval sheets will be attached upon

completion of report.

Bill of materials

Timing Belt, 6mm Width, GT2 Pitch, 216mm pitch length, SDP/SI #A6R51M108060 x 1 $5.03

Timing Pulleys, 6mm Belt, GT2 Pitch, 26.7mm Pitch Diameter, SDP/Si #A6A51M042DF0606 x2 $15.21

Pololu Stamped Aluminum L-Bracket Pair for 37D mm Metal #1084 x1 $7.95

Assembly Manual

1.Place hub on top of input link, making sure to line up hole of hub with that of the link

2.Pin hub to input link

3.Attach second hub to tensioning link

4.Assemble motor bracket mount by screwing the two pieces together with 8-32 bolts

5.Attach motor bracket mount to arena using ⅜-16 bolt. Hand tighten bolt, making sure bracket can still

rotate

6.Mount motor bracket and motor assembly onto motor bracket mount, ensuring input and output

pulleys are in the same vertical plane

7.Align timing belt in both pulleys, and rotate motor bracket mount until desired tension is achieved

8.Tighten bolt, which will fix the motor bracket mount in place and secure base plate on arena

Appendix D: Wiring Diagram, Arduino Code, Calculations, and Bill of

Materials for Safety & Motor Controls (Due with Final Report):

Wiring Diagram

Page 54: Automated Laser Reflection Report

Arduino Code (note: encoder positions may differ from calculated, due to sensor placement and calibration positions)

0 // ME350 Laser Reflection Sketch - W15 Team 36 1 // updated 4-9-2014 2 3 ////////////////////////////////////////////// 4 // DEFINE CONSTANTS AND GLOBAL VARIABLES: // 5 ////////////////////////////////////////////// 6 7 // Targets: 8 const int DES_POSITION_1 = 133; 9 // [encoder counts] Motor position corresponding to first lane (suggest to put it as 0) 10 const int DES_POSITION_2 = 98; 11 // [encoder counts] Motor position corresponding to second lane 12 const int DES_POSITION_3 = 54; 13 // [encoder counts] Motor position corresponding to third lane 14 const int DES_POSITION_4 = 13; 15 // [encoder counts] Motor position corresponding to fourt lane 16 const int DES_POSITION_1b = 138; 17 // [encoder counts] Motor position corresponding to first lane (suggest to put it as 0) 18 const int DES_POSITION_2b = 100; 19 // [encoder counts] Motor position corresponding to second lane 20 const int DES_POSITION_3b = 58; 21 // [encoder counts] Motor position corresponding to third lane 22 const int DES_POSITION_4b = 19; 23 // [encoder counts] Motor position corresponding to fourt lane 24 const int LOWER_BOUND = 0; 25 // [encoder counts] For calibration. If the upper limit switch is on, the motor position

will be reset to this value 26 const int UPPER_BOUND = 0; 27 // [encoder counts] For calibration. If the upper limit switch is on, the motor position

will be reset to this value

Page 55: Automated Laser Reflection Report

28 boolean iscalibrated = 0; 29 // Initialize system as not calibrated 30 31 // Sensor settings: 32 const int PROX_SWITCH_THRESHOLD = 150; 33 // [0-1023] thershold value after which the proximity switch turns off 34 35 // Computation of position and velocity: 36 volatile long motorPosition = 0; 37 // [encoder counts] Current motor position (Declared 'volatile', since it is updated in a

function called by interrupts) 38 volatile int encoderStatus = 0; 39 // [binary] Past and Current A&B values of the encoder 40 // The rightmost two bits of encoderStatus will store the encoder values from the current

iteration (A and B). 41 // The two bits to the left of those will store the encoder values from the previous

iteration (A_old and B_old). 42 float motorVelocity = 0; 43 // [encoder counts / seconds] Current motor velocity 44 long previousMotorPosition = 0; 45 // [encoder counts] Motor position the last time a velocity was computed 46 long previousVelCompTime = 0; 47 // [microseconds] System clock value the last time a velocity was computed 48 const int MIN_VEL_COMP_COUNT = 2; 49 // [encoder counts] Minimal change in motor position that must happen between two velocity

measurements 50 const long MIN_VEL_COMP_TIME = 5000; 51 // [microseconds] Minimal time that must pass between two velocity measurements 52 int previouslane = 0; 53 54 // Control 55 int targetPosition = 0; // [encoder counts] desired motor position 56 float positionError = 0; // [encoder counts] Position error 57 float integralError = 0; // [encoder counts * seconds] Integrated position error 58 float velocityError = 0; // [encoder counts / seconds] Velocity error 59 float desiredVoltage = 0; // [Volt] Desired motor voltage 60 int motorCommand = 0; // [0-255] PWM signal sent to the motor 61 const float KP = 0.25; // [Volt / encoder counts] P-Gain 62 const float KI = 0.05; // [Volt / (encoder counts * seconds)] I-Gain 63 const float KD = 0.003; // [Volt * seconds / encoder counts] D-Gain 64 const float BASE_CMD = 1.7*2.15; 65 // [Volt] Base voltage that is needed to make the motor just start to rotate 66 const int CTRL_DEAD_BAND = 4; 67 // [encoder counts] "Close enough" range, in which the controller does not send a voltage to

the motor 68 const float SUPPLY_VOLTAGE = 9.0; // [Volt] Supply voltage at the HBridge 69 70 // Time keeping: 71 unsigned long executionDuration = 0; 72 // [microseconds] Time between this and the previous loop execution 73 unsigned long lastExecutionTime = 0; 74 // [microseconds] System clock value at the moment the loop was started the last time 75 76 // Pin assignment 77 const int PIN_NR_ENCODER_A = 2; 78 // Never change these, since the interrupts are attached to pin 2 and 3 79 const int PIN_NR_ENCODER_B = 3; 80 // Never change these, since the interrupts are attached to pin 2 and 3 81 const int PIN_NR_LANE_1 = 4; 82 const int PIN_NR_LANE_2 = 6; 83 const int PIN_NR_LANE_3 = 12; 84 const int PIN_NR_LANE_4 = 13;

Page 56: Automated Laser Reflection Report

85 const int PIN_NR_ON_OFF_SWITCH = 5; 86 const int PIN_NR_FWD_LIMIT_SWITCH = 7; 87 const int PIN_NR_REV_LIMIT_SWITCH = 8; 88 const int PIN_NR_PROX_SWITCH_1 = 1; 89 const int PIN_NR_PWM_OUTPUT = 9; 90 const int PIN_NR_PWM_DIRECTION_1 = 10; 91 const int PIN_NR_PWM_DIRECTION_2 = 11; 92 93 94 ////////////////////////////////////////////////////////////////////// 95 // This is a function to update the encoder count in the Arduino. // 96 // It is called via an interrupt whenever the value on encoder // 97 // channel A or B changes. // 98 ////////////////////////////////////////////////////////////////////// 99 void updateMotorPosition() { 100 // Bitwise shift left by one bit, to make room for a bit of new data: 101 encoderStatus <<= 1; 102 // Use a compound bitwise OR operator (|=) to read the A channel of the encoder (pin 2) 103 // and put that value into the rightmost bit of encoderStatus: 104 encoderStatus |= digitalRead(2); 105 // Bitwise shift left by one bit, to make room for a bit of new data: 106 encoderStatus <<= 1; 107 // Use a compound bitwise OR operator (|=) to read the B channel of the encoder (pin 3) 108 // and put that value into the rightmost bit of encoderStatus: 109 encoderStatus |= digitalRead(3); 110 // encoderStatus is truncated to only contain the rightmost 4 bits by using a 111 // bitwise AND operator on mstatus and 15(=1111): 112 encoderStatus &= 15; 113 if (encoderStatus==2 || encoderStatus==4 || encoderStatus==11 || encoderStatus==13) 114 { // the encoder status matches a bit pattern that requires counting up by one 115 motorPosition++; // increase the encoder count by one 116 } 117 else 118 { // the encoder status does not match a bit pattern that requires counting up by one. 119 // Since this function is only called if something has changed, we have to count

downwards 120 motorPosition--; // decrease the encoder count by one 121 } 122 } 123 124 125 ////////////////////////////////////////////////////////////////////////////////////////// 126 // The setup() function is called when a sketch starts. Use it to initialize variables, // 127 // pin modes, start using libraries, etc. The setup function will only run once, after // 128 // each powerup or reset of the Arduino board: // 129 ////////////////////////////////////////////////////////////////////////////////////////// 130 void setup() { 131 // Declare which digital pins are inputs and which are outputs: 132 pinMode(PIN_NR_ENCODER_A, INPUT); 133 pinMode(PIN_NR_ENCODER_B, INPUT); 134 pinMode(PIN_NR_LANE_1, INPUT); 135 pinMode(PIN_NR_LANE_2, INPUT); 136 pinMode(PIN_NR_LANE_3, INPUT); 137 pinMode(PIN_NR_LANE_4, INPUT); 138 pinMode(PIN_NR_ON_OFF_SWITCH, INPUT); 139 pinMode(PIN_NR_FWD_LIMIT_SWITCH, INPUT); 140 pinMode(PIN_NR_REV_LIMIT_SWITCH, INPUT); 141 pinMode(PIN_NR_PWM_OUTPUT, OUTPUT); 142 pinMode(PIN_NR_PWM_DIRECTION_1, OUTPUT); 143 pinMode(PIN_NR_PWM_DIRECTION_2, OUTPUT); 144 145 // Turn on the pullup resistors on the encoder channels

Page 57: Automated Laser Reflection Report

146 // (the other sensors already have physical resistors on the breadboard) 147 digitalWrite(PIN_NR_ENCODER_A, HIGH); 148 digitalWrite(PIN_NR_ENCODER_B, HIGH); 149 150 // Activate interrupt for encoder pins. 151 // If either of the two pins changes, the function 'updateMotorPosition' is called: 152 attachInterrupt(0, updateMotorPosition, CHANGE); 153 // Interrupt 0 is always attached to digital pin 2 154 attachInterrupt(1, updateMotorPosition, CHANGE); 155 // Interrupt 1 is always attached to digital pin 3 156 157 // Set initial output to the motor to 0 158 analogWrite(PIN_NR_PWM_OUTPUT, 0); 159 160 // Begin serial communication for monitoring. 161 Serial.begin(115200); 162 Serial.println("start"); 163 } 164 165 166

//////////////////////////////////////////////////////////////////////////////////////////////// 167 // After creating a setup() function, which initializes and sets the initial values,

// 168 // the loop() function does precisely what its name suggests, and loops consecutively,

// 169 // allowing your program to change and respond. Use it to actively control the Arduino board.

// 170

//////////////////////////////////////////////////////////////////////////////////////////////// 171 void loop() { 172 // Determine the duration it took to execute the last loop. This time is used 173 // for integration and for monitoring the loop time via the serial monitor. 174 executionDuration = micros() - lastExecutionTime; 175 lastExecutionTime = micros(); 176 177 // Read sensor signals from pins 178 int proxSwitch1 = analogRead(PIN_NR_PROX_SWITCH_1); 179 int limitSwitchForward = digitalRead(PIN_NR_FWD_LIMIT_SWITCH); 180 int limitSwitchReverse = digitalRead(PIN_NR_REV_LIMIT_SWITCH); 181 int onOffSwitch = digitalRead(PIN_NR_ON_OFF_SWITCH); 182 int lane1 = digitalRead(PIN_NR_LANE_1); 183 int lane2 = digitalRead(PIN_NR_LANE_2); 184 int lane3 = digitalRead(PIN_NR_LANE_3); 185 int lane4 = digitalRead(PIN_NR_LANE_4); 186 187 188 // Calibration: 189 if (limitSwitchReverse == HIGH && motorVelocity==0) 190 { // If the lower limit switch is active ... 191 // ... set encoder count value to lower bound: 192 motorPosition = LOWER_BOUND; 193 } 194 if (limitSwitchForward == HIGH && motorVelocity==0) 195 { // If the upper limit switch is active ... 196 // ... set encoder count value to upper bound: 197 motorPosition = UPPER_BOUND; 198 } 199 200 // Speed Computation: 201 if (abs(motorPosition - previousMotorPosition) > MIN_VEL_COMP_COUNT || 202 (micros() - previousVelCompTime) > MIN_VEL_COMP_TIME)

Page 58: Automated Laser Reflection Report

203 { // If at least a minimum time interval has elapsed or 204 // the motor has travelled through at least a minimum angle ... 205 // .. compute a new value for speed: 206 // (speed = delta angle [encoder counts] divided by delta time [seconds]) 207 motorVelocity = (double)(motorPosition - previousMotorPosition) * 1000000 / 208 (micros() - previousVelCompTime); 209 // Remember this encoder count and time for the next iteration: 210 previousMotorPosition = motorPosition; 211 previousVelCompTime = micros(); 212 } 213 214 // Control: 215 if (!iscalibrated && proxSwitch1<PROX_SWITCH_THRESHOLD && onOffSwitch==HIGH) 216 { 217 desiredVoltage = -1.4*BASE_CMD; //moves linkage slowly until hits hard stop 218 if (limitSwitchReverse == HIGH && motorVelocity==0 ) { 219 iscalibrated = 1; 220 desiredVoltage = 0; 221 //if the linkage hits the reverse limit switch 222 //then the encoder count sets to zero and our system should be calibrated 223 } 224 } 225 226 else if (onOffSwitch==HIGH && proxSwitch1<PROX_SWITCH_THRESHOLD && iscalibrated) 227 { // If the toggle switch is on and there is nothing in the proximity sensor range... 228 // .. run the controller: 229 230 // Determine which lane has a laser on; set that lane's encoder count as the desired

position 231 if (lane1==HIGH ) { 232 targetPosition = DES_POSITION_1; 233 if (previouslane > 1) targetPosition = DES_POSITION_1b; 234 previouslane = 1; 235 } else if (lane2==HIGH) { 236 targetPosition = DES_POSITION_2; 237 if (previouslane > 2) targetPosition = DES_POSITION_2b; 238 previouslane = 2; 239 } else if (lane3==HIGH) { 240 targetPosition = DES_POSITION_3; 241 if (previouslane > 3) targetPosition = DES_POSITION_3b; 242 previouslane = 3; 243 } else if (lane4==HIGH) { 244 targetPosition = DES_POSITION_4; 245 previouslane = 4; 246 } else { 247 // no target specified, do nothing and leave value at previous value 248 } 249 250 // Compute the position error [encoder counts] 251 positionError = targetPosition - motorPosition; 252 253 // Compute the integral of the position error [encoder counts * seconds] 254 if (abs(positionError) < CTRL_DEAD_BAND) 255 { 256 // prevent the integral error from continuing to accumulate, if the position is

close enough 257 integralError = integralError; 258 } 259 else 260 { 261 integralError = integralError + positionError * (float)(executionDuration) /

1000000;

Page 59: Automated Laser Reflection Report

262 } 263 264 265 // Compute the velocity error (desired velocity is 0) [encoder counts / seconds] 266 velocityError = 0 - motorVelocity; 267 268 // Use a PID controller to send the appropriate signal to the motor 269 // This uses the function "PID_Controller" at the end of the sketch 270 desiredVoltage = PID_Controller(positionError, integralError, velocityError); 271 } 272 273 else 274 { // Otherwise, either the toggle switch is off or there is something in the proximity

sensor range, so... 275 // ... do not run the controller, stop the motor: 276 desiredVoltage = 0; 277 // .. and reset the integrator of the error: 278 integralError = 0; 279 // Produce some debugging output: 280 if(onOffSwitch==LOW) 281 { // If the toggle switch is off... 282 // .. notify the user 283 Serial.println("Warning: The toggle switch is off."); 284 } 285 else 286 { // Otherwise something is in the way of the proximity sensor, so... 287 // ... notify the user 288 Serial.println("Warning: There is an object in the way."); 289 } 290 } 291 292 293 294 295 // Send the command (either result of control, or 0) to the H-bridge 296 // Convert from voltage to PWM cycle: 297 motorCommand = int(abs(desiredVoltage * 255 / SUPPLY_VOLTAGE)); 298 // Clip values larger than 255 299 if (motorCommand > 255) 300 { 301 motorCommand = 255; 302 Serial.println("Warning: Exceeded maximal desired voltage. Anti-Windup might be

needed."); 303 } 304 analogWrite(PIN_NR_PWM_OUTPUT, motorCommand); 305 // Determine rotation direction 306 if (desiredVoltage >= 0) 307 { // If voltage is positive ... 308 // ... turn forward 309 digitalWrite(PIN_NR_PWM_DIRECTION_1,LOW); // rotate forward 310 digitalWrite(PIN_NR_PWM_DIRECTION_2,HIGH); // rotate forward 311 } 312 else 313 { // ... otherwise turn backward: 314 digitalWrite(PIN_NR_PWM_DIRECTION_1,HIGH); // rotate backward 315 digitalWrite(PIN_NR_PWM_DIRECTION_2,LOW); // rotate backward 316 } 317 318 // Send a status of the controller to the serial monitor. 319 // Each character will take 85 microseconds to send, so be 320 // selective in what you write out: 321 // if (printCounter == FREQUENCY_OF_PRINTING)

Page 60: Automated Laser Reflection Report

322 // { 323 324 //Serial.print("Power switch [on/off]: "); 325 Serial.print(iscalibrated); 326 Serial.print("PWR: "); 327 Serial.print(onOffSwitch); 328 //Serial.print(" Motor Position [encoder counts]: "); 329 Serial.print(" MP: "); 330 Serial.print(motorPosition); 331 //Serial.print(" Motor Velocity [encoder counts / seconds]: "); 332 Serial.print(" MV: "); 333 Serial.print(motorVelocity); 334 //Serial.print(" Encoder Status [4 bit value]: "); 335 Serial.print(" ES: "); 336 Serial.print(encoderStatus); 337 //Serial.print(" Target Position [encoder counts]: "); 338 Serial.print(" TP: "); 339 Serial.print(targetPosition); 340 //Serial.print(" Position Error [encoder counts]: "); 341 Serial.print(" PE: "); 342 Serial.print(positionError); 343 //Serial.print(" Integrated Error [encoder counts * seconds]: "); 344 Serial.print(" IE: "); 345 Serial.print(integralError); 346 //Serial.print(" Velocity Error [encoder counts / seconds]: "); 347 Serial.print(" VE: "); 348 Serial.print(velocityError); 349 //Serial.print(" Desired Output Voltage [Volt]: "); 350 Serial.print(" DV: "); 351 Serial.print(desiredVoltage); 352 //Serial.print(" Motor Command [0-255]: "); 353 Serial.print(" MC: "); 354 Serial.print(motorCommand); 355 //Serial.print(" Execution Duration [microseconds]: "); 356 Serial.print(" ED: "); 357 Serial.print(executionDuration); 358 Serial.println(""); // new line 359 360 361 } // End of main loop 362 363 364 ////////////////////////////////////////////////////////////////////////////////////////// 365 // This is the actual controller function that uses the error in position and velocity // 366 // and the integrated error and computes a desired voltage that should be sent to the // 367 // motor. In addition to the standard PID controller, a feedforward voltage is also // 368 // computed additively to compensate for friction. // 369 ////////////////////////////////////////////////////////////////////////////////////////// 370 float PID_Controller(int positionError_, int integralError_, float velocityError_ ) 371 { 372 float desiredVoltage_; // [Volt] Desired motor voltage 373 374 // //limit the error, to reduce overshoot if travelling through a large angle 375 // if(positionError_ > 120) 376 // { 377 // positionError_ = 120; 378 // } 379 // if(positionError_ < -120) 380 // { 381 // positionError_ = -120; 382 // } 383

Page 61: Automated Laser Reflection Report

384 // PID control equation: 385 desiredVoltage_ = KP * positionError_ + 386 KI * integralError_ + 387 KD * velocityError_; 388 389 // Add a fixed value in the direction of desired motion to overcome friction etc. 390 if (desiredVoltage_ < 0) 391 { 392 desiredVoltage_ = desiredVoltage_ - BASE_CMD; 393 } 394 395 else 396 { 397 desiredVoltage_ = desiredVoltage_ + BASE_CMD; 398 } 399 400 401 // If we are close enough to the desired target, turn motor off: 402 if (abs(positionError_) < CTRL_DEAD_BAND) 403 { 404 desiredVoltage_ = 0; 405 } 406 407 // Return the desired voltage to the loop-function 408 return desiredVoltage_; 409 }

Calculations:

C = DNE/360

where C is the number of encoder counts required to reach the desired position, D is the degrees of

movement required to reach the desired position (degrees), N is the transmission ratio (including

attached gearbox), and E is the encoder counts/rev. With our fixed transmission ratio and encoder

counts/rev, we can simply multiply the degrees by 3.378 to determine the encoder counts:

C = 3.378D

These calculations can be seen in the encoder counts table above in the report.

Safety and Motor Controls Bill of Materials:

Infrared Proximity Sensor, short range, GP2D120XJ00F, Sparkfun x1

Snap Action Switch (a.k.a. limit switch, microswitch), 187733, Jameco x2

Toggle Switch Single Pole Single Throw (On-Off), 76523, Jameco x1

400-point Breadboard, 351, Pololu x1

Arduino Uno microcontroller board, DEV-09950, Sparkfun x1

H-bridge (L298 Motor Driver -- preassembled), K CMD, Solarbotics x1

Mounting Board for Arduino, H-bridge, and breadboard, Custom x1