the design of a high-concentration microtracking

77
The Pennsylvania State University The Graduate School College of Engineering THE DESIGN OF A HIGH-CONCENTRATION MICROTRACKING PHOTOVOLTAIC SYSTEM A Thesis in Mechanical Engineering by Gregory S. Brulo 2018 Gregory S. Brulo Submitted in Partial Fulfillment of the Requirements for the Degree of Master of Science May 2018

Upload: others

Post on 28-Dec-2021

1 views

Category:

Documents


0 download

TRANSCRIPT

The Pennsylvania State University

The Graduate School

College of Engineering

THE DESIGN OF A HIGH-CONCENTRATION

MICROTRACKING PHOTOVOLTAIC SYSTEM

A Thesis in

Mechanical Engineering

by

Gregory S. Brulo

2018 Gregory S. Brulo

Submitted in Partial Fulfillment

of the Requirements

for the Degree of

Master of Science

May 2018

ii

The thesis of Gregory S. Brulo was reviewed and approved* by the following:

Christopher D. Rahn

Professor of Mechanical Engineering

Thesis Advisor

H. J. Sommer

Professor of Mechanical Engineering

Karen Thole

Distinguished Professor of Mechanical Engineering

Head of the Department of Mechanical Engineering

*Signatures are on file in the Graduate School

iii

ABSTRACT

High-concentration photovoltaic systems can provide power conversion efficiency that is

nearly double that of conventional solar panels. Concentrating photovoltaics (CPV) cannot

compete with fixed silicon panels for rooftop installations due to the complexity and cost of CPV

two-axis pedestal tracking systems. Fixed optic designs have recently been proposed that have a

transparent middle sheet with small, widely spaced, and highly efficient solar cells sandwiched

between a fixed lenslet array on top and fixed reflector array on the bottom. Precision actuators

position the middle sheet at the focal points of the lenslet/reflector array to microtrack the sun

throughout the day. This paper discusses the kinematic design and control of Shape Memory

Alloy (SMA) actuators used for the first time in this application. SMA actuators have the

potential to be less expensive, easier to integrate, and lower power than electric motors. The

kinematic design maintains upper and lower bounds on wire tension to prevent failure and ensure

reversible actuation, respectively. The SMA actuators under quasi-linearized PID control can

position the middle sheet with +/- 7 mm of range in the vertical and horizontal directions while

ensuring less than 1.9 µm of steady state error in SMA actuator stroke. The middle sheet position

and orientation errors, however, exceed 1 mm and 0.5o, respectively. These relatively large errors

are due to flexibility in the suspension system, friction at wire supports, and large kinematic gains

at extreme positions and indicate the need for middle sheet error measurement and feedback

control.

iv

TABLE OF CONTENTS

List of Figures .......................................................................................................................... v

List of Tables ........................................................................................................................... vi

List of Abbreviations ............................................................................................................... vii

Acknowledgements .................................................................................................................. viii

Chapter 1 Introduction and Motivation .................................................................................... 1

Chapter 2 Mechanical Design .................................................................................................. 3

CPV Microtracking System Design ................................................................................. 3 SMA Mechanism Design ................................................................................................. 5

Chapter 3 Detailed Design ....................................................................................................... 9

Kinematic Solution .......................................................................................................... 9

Chapter 4 Control ..................................................................................................................... 15

Implementation ................................................................................................................ 15 PID Control Design .......................................................................................................... 15 Dynamic Response ........................................................................................................... 16 Calibration and Kinematic Performance .......................................................................... 17 Power Consumption ......................................................................................................... 19

Chapter 5 Conclusion ............................................................................................................... 21

Bibliography ............................................................................................................................ 22

Appendix MATLAB Kinematic Codes .................................................................................. 23

v

LIST OF FIGURES

Figure 1. Full scale High-Concentration Microtracking Photovoltaic System: (a) Partical

section view, (b) Mid day, (c) Late afternoon and (d) Late evening. ............................... 4

Figure 2. CPV microtracking prototype design ...................................................................... 5

Figure 3. Mobility analysis of the SMA planar mechanism concept: (a) Variable link

lengths and (b) Fixed link lengths .................................................................................... 6

Figure 4. CPV microtracking array position/orientation control hardware and middle

sheet free body diagram ................................................................................................... 7

Figure 5 Operating position envelope for the middle sheet .................................................... 8

Figure 6 Static forces for an example configuration at positions A-F shown in Fig. 5:

Links 2 (○), 4 (*), 5 (□), and 6 (x). Maximum and minimum forces are the dotted

and dash-dotted lines, respectively, for 0.51 mm (blue) and 0.38 mm (red) diameter

Dynalloy SMA wire ......................................................................................................... 12

Figure 7 Minimum and maximum strain reserves design candidates (blue dots) and

design point (red circle) ................................................................................................... 13

Figure 8 Kinematic prototype tested in this paper .................................................................. 14

Figure 9 PID control response for a 100 micron x translation: (a) Desired (red dashed

line) and actual trajectory (blue solid line) and (b) PWM signal for link 2; (c)

Desired (red dashed line) and actual trajectory (blue solid line) and (d) PWM signal

for link 4; (e) Desired (red dashed line) and actual trajectory (blue solid line) and (f)

PWM signal for link 5 ...................................................................................................... 16

vi

LIST OF TABLES

Table 1. PID controller performance for SMA actuator wire #2 ............................................. 17

Table 2. Middle sheet position and orientation errors under PID control ................................ 19

vii

LIST OF ABBREVIATIONS

CPV. Concentrating Photovoltaic ....................................................................................... 1

PV. Photovoltaic ...................................................................................................................... 1

SMA. Shape Memory Alloy .................................................................................................... 1

PID. Proportional Integral Derivative ...................................................................................... 2

NEMA. National Electrical Manufactures Association ........................................................... 19

viii

ACKNOWLEDGEMENTS

I would like to thank Dr. Christopher Rahn for advising me during my graduate school

journey. Dr. Rahn always provided kind words of encouragement and motivation throughout this

research. Thank you Dr. Rahn for helping me develop to my fullest potential while at Penn State

and reach my goal of a Master of Science degree in Mechanical Engineering.

Thank you Dr. Chris Giebink, principal investigator, for providing me with the

opportunity to conduct this research. I thoroughly enjoyed working on your cross functional team

and appreciated your lab’s recourses, both hardware and staff, used on this project.

I would also like to think my colleagues who were a part of this research project and the

fellow graduate students in the lab: Jared Price, Alex Grede, Dr. Baomin Wang, Andrew Ren,

Matt Krott, Dr. Xiaokun Ma, Dr. Shawn Treacy, Jun Ma, Tahzib Safwat, Nicholas Papavizas and

Dr. Mayank Garg for helping me with hardware, software and keeping me entertained.

Most importantly I would like to thank my wife, Amy Brulo, who fully supported my

goal. Thank you for providing me with your love, encouragement and keeping me focused on

this journey.

This research was conducted at the Mechatronics Research Lab, Department of

Mechanical and Nuclear Engineering, The Pennsylvania State University, University Park,

Pennsylvania.

This work was supported by the Advanced Research Projects Agency-Energy (ARPA-E)

MOSAIC program, US Department of Energy, under Award No. DE-AR0000626. The views

and opinions of authors expressed herein do not necessarily state or reflect those of the United

States Government or any agency thereof.

1

Chapter 1

Introduction and Motivation

The cost of solar power has dropped drastically in recent years, encouraging record

numbers of installations and the proliferation of this renewable energy source [1-3].

Concentrating photovoltaics (CPV) are twice as efficient as traditional photovoltaics (15% versus

30%) [4] but they require sun tracking. CPV systems work by concentrating and focusing the

incoming light onto small and highly efficient solar cells. High-concentration (~100 – 1000x)

requires very accurate tracking due to the low angular acceptance characteristics of the optics [5].

CPV systems are often relatively large, use dual axis tracking mechanisms on top of pedestals,

and need to be strong enough to maintain performance during wind loading. Thus, the tracking

mechanism can be a significant portion of the system cost [6]. The CPV mechanism and structure

require a large working volume that inhibits rooftop installation. The design needs to be reliable

for the 25 year product lifespan of a typical solar panel system [4], longer than the lifetime of

many electromechanical components that are continuously exposed to the environment.

Micro-optic solar concentrators use smaller optics to concentrate light onto

individual cells or a shared PV cell. Hallas et al. [6] designed a system where the micro optics

array focuses light onto a prism array that reflects the light to one edge of the array where a single

PV cell harvests the energy. This system can be mounted on a two axis rotating pedestal and

controlled to maintain normal incidence with the sun. Alternatively, the optic array is fixed but

the prism array translates up to 4 mm in each direction with high precision to maintain alignment

with the PV cell. Three cams driven by stepper motors control the position of the prism array [5-

7].

2

Price et al. [4] describe a fully automated planar microtracking CPV system that

is roof mounted and operates at a fixed tilt with microscale triple-junction solar cells at more than

660X concentration ratio over a 140o field of view. In this design, a transparent middle sheet

with embedded microscale solar cells is sandwiched between a lenslet array on top and a reflector

array on the bottom. The middle sheet moves during the day to align the solar cells with the

incoming solar radiation. Experimental tests with a single cell demonstrated 50% more energy

per unit area per day than a commercial silicon solar cell.

Shape Memory Alloy (SMA) actuators are an attractive alternative to electric

motors for CPV microtracking applications. Relative to electric motors, SMA actuators can be

less expensive, more reliable, easily integrated, and lower power [8]. In addition, SMA actuators

are easily maintained, provide clean and silent actuation, and controllable with simple (e.g. PID)

feedback algorithms [9].

This paper is the first to use SMA actuators for CPV microtracking applications.

An SMA microtracking system is designed for a multi-cell CPV system based on the work of [4].

The kinematics using three SMA actuators and a passive spring are derived and a wide search for

design alternatives is undertaken. Design constraints include the maximum and minimum force

in the actuator wires and minimum actuated vertical and horizontal displacements and rotations.

3

Chapter 2

Mechanical Design

CPV Microtracking System Design

Figure 1(a) shows a conceptual drawing of the microtracking CPV design in [4] as

envisioned for a panel with multiple solar cells. The structure has three layers: A top

concentrating lenslet array, a transparent middle PV array, and a bottom mirror array. The system

is surrounded a small footprint frame to maximize the W/m2, a key metric for solar panels. In this

design, the frame, lenslet array, and mirror array are stationary. The photovoltaic cells are

arranged in a grid pattern on the middle sheet. All three layers are made from transparent

materials such as acrylic or glass. The lenslet and mirror arrays are molded to produce the

desired optics and coated with anti-reflective and reflective layers, respectively. The middle sheet

is sandwiched between the top and bottom array and surrounded with index matching fluid to

minimize refraction. Figure 1(b) shows that the PV cells are directly below the lenslets at noon

with a perfectly tilted panel. The focused light spot moves from left to right during the day and

the middle sheet tracks this motion to keep the PV cells in the spotlight. The required

displacement is roughly equal to the size of the lenslets. For the purposes of this paper, we

assume a +/- 7 mm motion requirement in the horizontal and vertical directions. Rotation of the

middle sheet causes the cells at the periphery to move out of the spotlight. Thus, accurate

rotation control is also required.

4

Fig. 1 Full scale High-Concentration Microtracking Photovoltaic System: (a) Partical

Section View, (b) Mid day , (c) Late afternoon, and (d) Late evening.

Figure 2 shows the design of the prototype CPV microtracking array studied in this

paper. The concentrating lenslet array, middle sheet, and mirror array are stacked on top of each

other. The frame and frame cap secure the mirror and lenslet arrays, respectively, seal the index

matching fluid using O-rings, and house the SMA actuators. Each of the three SMA wires is

anchored to the frame at one end and attached to a secondary cable. The secondary cable is

wrapped around an encoder shaft that measures the stroke of the SMA actuator. From the

encoder the secondary cable feeds through gaps in the mirror array, and anchors to the middle

sheet. Each SMA wire is electrically grounded near the encoder and connected to a controlled

amplifier at the frame anchor. An additional cable (not shown in Fig. 2) attaches the middle

sheet to a spring to ensure that all of the cables and SMA wires remain under tension during

operation. The frame has significant dead space to allow exploration of the design space without

5

significant redesign. In an actual PV panel, the actuators and seals could be more tightly

packaged to increase energy density.

Fig. 2 CPV mictrotracking prototype design.

SMA Mechanism Design

Figure 3 shows that the middle sheet moves in x translation, y translation and θ rotation

so three actuators are used to control these three degrees of freedom. The mechanism consists of

three SMA links with variable lengths. Figure 3(a) shows the 8 links and 9 joints of the planar

mechanism. Grübler Kutzbach analysis [10] calculates that this mechanism has 3 degrees of

freedom so the middle sheet (link 4 in Fig. 3 (a)) can translate in both planar directions and rotate.

The mechanism in Fig. 3 (b) corresponds to the system with five, fixed-length SMA links and 6

joints. Grübler Kutzbach analysis calculates that this mechanism has 0 degrees of freedom and is

6

a structure. Thus, if the SMA lengths are regulated at a fixed value, the middle sheet will hold its

position.

Fig. 3 Mobility analysis of the SME planar mechanism concept: (a) Variable link lengths

and (b) Fixed link lengths.

For the proposed optics, the middle sheet moves 14 mm in the x direction over 12 hours

as the sun rises and sets. The sun changes position in the sky during the year and this requires y

translation of the middle sheet. To allow complete coverage of the sky and flexibility of

mounting orientation, the 14 mm x direction specification carries over to the y direction as well.

SMA actuators are well suited to this slow but precise movement.

Figure 4 shows three SMA actuators and a spring pulling on the middle sheet to change

its position/orientation and maintain tension in the cables, respectively. Three encoders measure

the length of the SMA actuators. The device kinematics map the encoder measurements to

middle sheet position and orientation, assuming straight and inextensible cables. The SMA

actuators are resistively heated by current flowing from fixed anchors connected to the amplifier

input voltage through crimps to ground wires near the encoders. The crimps also attach the SMA

wires to the secondary control wires that wrap around encoder shafts and run through a wire

7

feedthrough in the frame to the middle sheet. Link 1 is the frame or ground, link 2, 4 and 5 are

actuators, link 3 is the middle sheet and link 6 is a tension spring.

Fig. 4 CPV microtracking array position/orientation control hardware and middle

sheet free body diagram.

Figure 5 shows the middle sheet range of motion needed for the proposed optics. The

points A through H are the extremes of the middle sheet position that give maximum flexibility in

mounting orientation. The design of the proposed microtracking system involves ensuring the

desired tracking of points A through H with 50 µm accuracy while maintaining cable tensions F2,

F4, F5, and F6 in a desired range. To maximize W/m2, the gap between the middle sheet and

frame should be as small as possible. In this study, the middle sheet is scaled down from a

typical 1 m x 1 m array to 140 mm x 140 mm for reduced complexity in a proof-of-concept

device. Adding 14 mm of travel means the frame must be at least 154 mm x 154 mm. At the

8

extremes of movement with this minimum clearance design, however, the transmission angles

become large and the tension forces spike. Thus, the design includes a complex tradeoff between

W/m2 and SMA actuator size.

Fig. 5 Operating position envelope for the middle sheet

9

Chapter 3

Detailed Design

Kinematic Solution

To find motion control solutions that meet the displacement and force requirements, the

kinematics are solved numerically for millions of combinations of actuator link and spring link

placements. The links are assumed to be distributed around the middle sheet as follows: one

actuator on the left, two actuators on the top, and a tension spring on either the bottom or right.

All sides of the middle sheet and the frame are discretized into seven possible attachment points.

Iterating through all attachment points on the frame and middle sheet for all four links produces

millions of possible designs. The solutions were tested at all positions in Fig. 5.

The kinematic analysis is based on Haug [11], where the variables are defined as follows:

ri=[rix, riy]T Global position of body i’s origin

ri P Global position of point P on body i

si'P Position of point P on body i measured from body i’s

origin

si P Position of point P on body i relative to body i’s origin

but measured using the global coordinate frame

Φi Orientation for reference frame attached to body i

Ai Orthonormal rotation matrix for body i

The rotation matrices transform from local to global coordinates

si P=Aisi

'P

10

ri P=ri + Aisi

'P

The frame is fixed at r1=[0, 0]T and r3=[r3x, r3y]T

where r3x and r3y are the given location

of the center of the middle sheet relative to the center of the frame shown in Fig. 5. The kinematic

equations for link 2 are given by

r1 A=r1 + A1s1

'A (1)

r3 A=r3 + A3s3

'A (2)

d2=r3 A - r1

A (3)

L2=∥d2∥ (4)

Φ21= tan-1 (

d2y

d2x

) (5)

θ2=Φ2 + π (6)

Vectors are similarly calculated for the other three links using Eq. (1) through Eq. (6).

The free body diagram of the middle sheet shown in Fig. 4 is used to calculate

the cable tensions and includes the gravitational load

Fwy=(mg - FB)sin(Φincline) (7)

The solar panel system will be installed at an angle Φincline so, for example, it is facing

south if installed in the northern hemisphere. The middle sheet will be submerged in a refractive

index matching fluid that produces a bouancy force FB. The middle sheet weight mg is larger

than FB so the mismatch will load the cable suspension.

The slow movement of the middle sheet means that a static analysis without fluid

drag and friction is appropriate. Link 6 is a spring that tensions links 2, 4 and 5 with the tension

force

F6=(L6 - L6i)k6 + F6i (8)

11

where F6i and k6 are the pretension and stiffness of the spring. Force and moment

balances yield

Figure 6 shows example forces in links 2, 4, 5 and 6. This design maintains all of the

links in tension at all six points of the operating envelope. If the SMA forces are too high,

however, the wires will not provide reliable and long-life operation. The SMA forces also cannot

be too low or the SMA material will not transition properly to provide reversible actuation. The

force window can be scaled by changing the wire diameter because the upper and lower limits are

stress-based. Figure 6 shows that using Dynalloy Flexinol® SMA wires with 0.51 mm diameter

for link 2 and 0.38 mm diameter for links 4 and 5 will keep the stresses in all actuators in their

desired ranges, ensuring reversible actuation for millions of cycles.

∑Fx=F2 cos(θ2) + F4 cos(θ4) + F5 cos(θ5) + F6 cos(θ6) =0

(

(9)

∑Fy=F2 sin(θ2) + F4 sin(θ4) + F5 sin(θ5) + F6 sin(θ6) - Fwy =0 (10)

∑M=F2[ sin(θ2), cos(θ2)] s3'A +

F4[ sin(θ4), cos(θ4)] s3'C + F5[ sin(θ5), cos(θ5)] s3

'B + F6[ sin(θ6), cos(θ6)] s3'D =0

(

(11)

12

Fig. 6 Static forces for an example configuration at positions A- F shown in Fig. 5: Links

2 (○), 4 (*), 5 (□), and 6 (x). Maximum and minimum forces are the dotted and dash-dotted lines,

respectively, for 0.51 mm (blue) and 0.38 mm (red) diameter Dynalloy SMA wire.

Figure 7 shows the 8,504 designs that meet Flexinol® wire specifications for maximum

and minimum strain in based on the reserves

where F2min and F2max are the minimum and maximum tension in the SMA actuator for all

positions, respectively, and Fe1 and Fc1 are the Dynalloy recommened minimum and maximum

tension, respectively, for the given diameter wire. The red circled dot in Fig. 7 is the chosen

design point. This solution provides favorable reserves for both the elongation and contraction of

the SMA actuator.

Relongation= (F2min - Fe1

Fe1

) 100% (12)

Rcontraction= (Fc1 - F2max

Fc1

) 100% (13)

13

Fig. 7 Minimum and maximum strain reserves design candidates (blue dots) and design

point (red circle).

Once the wire diameter has been chosen to meet the stress limits, wire length is scaled to

provide the desired displacement. Flexinol® wires can reliably produce 3% strain for millions of

cycles [8]. The maximum link change in length for the final design was 13.2 mm. This stroke

was 3% strain for a 440 mm SMA actuator but the wire length was increased to 500 mm to

provide additional actuation margin.

The final design is shown schematically in Fig. 4 and photographically in Fig. 8. The left

SMA wire (Link 5) attaches to the upper left corner of the middle sheet and passes through the

middle slot in the left side of the frame. The first top control wire (Link 2) attaches near the

middle of the top of the middle sheet and passes through the frame near the top middle. The

second top control wire (Link 4) attaches to the top right corner of the middle sheet and passes

through the frame near its top right corner. The spring attaches to the bottom near the middle of

the middle sheet and passes through the left side of the bottom of the frame. This design provides

both CW and CCW moments and +/- x and +/- y translations with all wires under tension at all

14

locations. The actuator for link 2 is 0.51 mm diameter SMA wire while links 4 and 5 both use

actuators with 0.38 mm diameter wire. Figure 8 shows the middle sheet, frame, SMA actuators,

encoders, and spring used for the fabricated prototype.

Fig. 8 Kinematic prototype tested in this paper.

15

Chapter 4

Control

Implementation

Middle sheet position control is implemented on an Ardunio Uno microcontroller. Three

40,000 count/revolution encoders measure the SMA wire lengths and provide the information to

the microcontroller using pulse count modules by GHI Electronics and a Serial Peripheral

Interface (SPI). Three PWM outputs from the microcontroller are amplified to resistively heat the

SMA actuators. Previous work on SMA has shown that PWM modulated control can reduce

power consumption by up to 30% compared to continuous control [12].

PID Control Design

PID controllers provide middle sheet position control by regulating the length of all three

actuators. The controllers are decoupled and use only feedback from their respective encoders.

The control objective is to move the middle sheet in the x and/or y directions without rotation. To

convert the desired x, y, and θ middle sheet position and orientation to link length commands, the

kinematics are quasi-linearized using

Gi=∆Li

∆x (14)

where the current position and orientation vector 𝒙 = [x, y, θ]𝑇, ∆x is the desired change

in position and orientation, and ∆𝐋𝐢 resulting change in link Li length. The gradient vector

Gi=[Gix, Giy,GiΦ]T is calculated and stored on the microcontroller for all points on a grid

16

pattern of 1 mm x 1 mm spacing within the hexagonal positioning envelope shown in Fig. 5.

Quasi-linearization is appropriate for small changes in configuration that would typically be

required during solar tracking.

Dynamic Response

Figure 9 shows a typical movement of the middle sheet, a 100 µm translation in the x

direction starting at the center location. The responses of links 2, 4, and 5 are shown with the

desired length calculated from Eq. (14) (dashed) and the actual response (solid). Link 2 contracts

while links 4 and 5 extend to enable the middle sheet to move horizontally without vertical

translation or rotation.

Fig. 9 PID control response for a 100 micron x translation: (a) Desired (red dashed line)

and actual trajectory (blue solid line) and (b) PWM signal for link 2; (c) Desired (red dashed line)

and actual trajectory (blue solid line) and (d) PWM signal for link 4; (e) Desired (red dashed line)

and actual trajectory (blue solid line) and (f) PWM signal for link 5.

The time response results summarized in Table 1 for each SMA actuator and the

overall middle sheet position control performance. The response differs for contraction

17

versus elongation of the SMA wire because resistive heating is faster than passive

cooling. The calculated time constant is twice as slow for cooling as heating except for

SMA actuator 5. Responding in one second, however, is sufficiently fast for the slow

solar tracking application. While the overshoot is somewhat large due to relatively large

gains and aggressive integral action, the steady state error is the most important to keep

the solar spot focused on the PV cell. The cell is roughly 650 microns square so 6.93 µm

of steady state error, is quite small. SMA actuators 4 and 5 have the same PID gains

however their response is quite different. This is due to the dynamic differences between

the two actuator interfaces.

Table 1 PID controller performance for SMA actuator wire #2

Step

Actuator

Response

Time

Constant

(sec)

Overshoot

(%)

RMS

Error

(counts)

RMS Error -

Actuator

Length

(µm)

RMS Error -

Photovoltaic

x Movement

(µm)

100 µm +x Actuator 2 0.34 21% 1.9 0.80 0.86

100 µm -x Actuator 2 0.7 35% 1.5 0.62 0.67

100 µm +x Actuator 4 0.61 35% 2.5 1.07 1.51

100 µm -x Actuator 4 0.39 66% 2.1 0.89 1.26

100 µm +x Actuator 5 1 30% 4.5 1.90 6.93

100 µm -x Actuator 5 1.1 54% 3.7 1.56 5.70

Calibration and Kinematic Performance

The time response results presented in the previous section pertain to the measured SMA

link lengths, not the position and orientation of the middle sheet. The flexibility of the cable

suspension of the middle sheet and other factors contribute to positioning errors even if the links

are exactly the right lengths. To assess the significance of these errors, a high resolution camera

18

(THORLABS DCC1645C) with a 12x lens (NAVITAR 12-1248) mounted 60 mm above the

middle sheet captures digital images that are processed to measure translation and rotation. The

resolution is limited to 0.03 mm for translations and 0.13° for rotation.

Table 2 shows the measured errors for position control at the center and around the

periphery of the hexagonal envelope in Fig. 5. The test starts at the center with the displacement

and rotation defined to be zero. After touching all points of the hexagon, the middle sheet returns

to the origin, showing relatively small translational errors of 150 µm and rotational errors of 0.13

degrees. At the periphery, however, the position errors exceed 1 mm and orientation errors are

near 1 degree. The PV cells are 650 x 650 µm so errors this large would move the solar spot

outside the cell, minimizing power generation. For a full scale solar panel, rotation errors are

most significant for the cells that are on the edge of the panel. Maintaining less than 650 µm in

displacement error for a 1 m panel, for example, requires rotation errors less than 0.08o. The

system design could be modified to reduce these errors by minimizing control wire stretch and

bending angles, both of which contribute to flexibility between the control wire attachment point

and the measured SMA wire connection.

The tracking system is designed to follow the sun autonomously and feedforward

information based on date, location, and time of day could be used to roughly position the middle

sheet. Offset photovoltaic cell feedback can then be used to center the energy harvesting PV cells

in the concentrated light continuously throughout the day. Positioning the middle sheet without

these offset photovoltaic cells, or similar additional feedback system, is not feasible for the

current design.

19

Table 2. Middle sheet position and orientation errors under PID control

Position

Desired Location

(mm)

Measured

Location (mm)

X Error

(mm)

Y Error

(mm)

Rotational

Error (°)

A 0 0 0 0 0 0 0

B 7 0 6.45 -0.17 -0.55 -0.17 0.13

C 3 6 1.89 5.55 -1.11 -0.45 0.78

D -3 6 -3.19 5.89 -0.19 -0.11 0.13

E -7 0 -6.07 0.23 0.93 0.23 -0.39

F -3 -6 -2.79 -5.78 0.21 0.22 0.00

G 3 -6 2.27 -5.92 -0.73 0.08 0.13

B 7 0 6.24 -0.23 -0.76 -0.23 0.39

A 0 0 -0.15 0.00 -0.15 0.00 0.13

Power Consumption

Assuming a solar irradiance of 1000 W/m2, a CPV panel with 30% power conversion

efficiency and 1 m2 area would produce 300 Watts. The SMA actuators consume a combined

total of 8.5 watts on the scaled prototype during typical operation of holding position, less than

3% parasitic power loss. The motion requirements will not scale with panel size so these

numbers hold for the full-scale device. SMA wires require continuous resistive heating to

compensate for heat loss, maintain temperature, and regulate length. A simple felt insulation

sleeve was installed around the SMA actuator wire and the power decreased by more than 20% so

insulation, while slowing the cooling response, can reduce power consumption. In addition the

kinematic geometry selected was optimized for reserves. The geometry can be optimized for

power consumption by lowering forces and selecting smaller diameter SMA actuator wires. A

NEMA 8 size stepper motor with 200 steps per revolution attached to a 64:1 gear ratio gearbox

has sufficiently small steps and high torque to drive the encoder shafts and would consume 3.6

20

watts. Thus, three stepper motors would consume slightly more power than the uninsulated SMA

actuator wire design.

21

Chapter 5

Conclusion

Using SMA actuator wires for high-concentration microtracking PV systems is viable for

low profile and high W/m2 solar panels that can be installed flat on rooftops. With three 0.5 m

long SMA actuator wires and a passive spring, the middle sheet can completely traverse the solar

cell dimensions and maintain desired tension levels. The SMA actuator wires under quasi-

linearized PID control demonstrate a steady state stoke error of 1.9 µm, over 300 times smaller

than the solar cell size. Middle sheet position and orientation control is insufficient, however, due

to flexibility in the cable suspension system. The speed of response is very fast relative to the

slow movement of the sun. Future work includes optimizing the kinematic geometry and SMA

actuator wire selection for power consumption and/or higher stiffness suspension of the middle

sheet and using middle sheet feedback to improve position and orientation control.

22

Bibliography

[1] Green, Martin A. "Commercial progress and challenges for photovoltaics." Nature

Energy 1 (2016): 15015.

[2] Lewis, Nathan S. "Research opportunities to advance solar energy

utilization." Science 351, no. 6271 (2016): aad1920.

[3] Woodhouse, Michael, Rebecca Jones-Albertus, David Feldman, Ran Fu, Kelsey

Horowitz, Donald Chung, Dirk Jordan, and Sarah Kurtz. "On the Path to SunShot. The

Role of Advancements in Solar Photovoltaic Efficiency, Reliability, and Costs." (2016).

[4] Price, Jared S., Alex J. Grede, Baomin Wang, Michael V. Lipski, Brent Fisher, Kyu-Tae

Lee, Junwen He et al. "High-concentration planar microtracking photovoltaic system

exceeding 30% efficiency." Nature Energy 2 (2017): nenergy2017113.

[5] Baker, Katherine A., Jason H. Karp, Eric J. Tremblay, Justin M. Hallas, and Joseph E.

Ford. "Reactive self-tracking solar concentrators: concept, design, and initial materials

characterization." Applied optics 51, no. 8 (2012): 1086-1094.

[6] Hallas, Justin M., Katherine A. Baker, Jason H. Karp, Eric J. Tremblay, and Joseph E.

Ford. "Two-axis solar tracking accomplished through small lateral translations." Applied

optics 51, no. 25 (2012): 6117-6124.

[7] Hallas, Justin M., Jason H. Karp, Eric J. Tremblay, and Joseph E. Ford. "Lateral

translation micro-tracking of planar micro-optic solar concentrator." In Proc. SPIE, vol.

7769, p. 776904. 2010.

[8] "Technical Characteristics of Flexinol Actuator Wires." Dynalloy.com

http://www.dynalloy.com/pdfs/TCF1140.pdf (Accessed December 2017).

[9] Elahinia, Mohammad H., and Hashem Ashrafiuon. "Nonlinear control of a shape memory

alloy actuated manipulator." Journal of vibration and acoustics 124, no. 4 (2002): 566-

575.

[10] Wohlhart, K. "Kinematotropic linkages." Recent Advances in Robot Kinematics 359368

(1996).

[11] Haug, Edward J. "Computer aided kinematics and dynamics of mechanical systems."

(1989): 32-34.

[12] Ma, N., and G. Song. "Control of shape memory alloy actuator using pulse width

modulation." Smart materials and structures 12, no. 5 (2003): 712.

23

Appendix

MATLAB Kinematic Codes

% File name - MOSAIC_kinematic_forces_main_rev_15.m

% - rev 15 -

% Greg Brulo

% MOSAIC Kinematics

% Spring 2017

% Use vector and matrix notation from Dr. Sommers Notes 04 01.

% Units are in mm, sec, N, radians unless stated otherwise

clear

clear all

clc

close all

stored_design=[0 0 0 0 0 0 0];

% enter a run number for saving outputs to a unique

prompt='enter run number';

get_number=inputdlg(prompt);

get_number=get_number{1};

run_number=strcat('run_',get_number);

d2r=pi/180; % convert from degrees to radians

%% step 1 - generate permutation information

% Load the permutaitons information

MOSAIC_permutations_rev_1

%comb_number=1;

comb_max=size(combinations_array,1);

%% step 2 - input other model info

% Spring info

% initial_length=60; % mm

k6=0.00; % N/mm 0.04

k7=0.04; % N/mm

k8=0.00; % N/mm

initial_tension_6=0; % 9 Newtons

initial_tension_7=9; % Newtons

initial_tension_8=0; % Newtons

% the following initial lengths are updated in solver loop

L6i=15;

L7i=21.2132;

L8i=15;

24

% configure the tilt info

mass=0.05; % kg 0.05

phi_incline=45*d2r;

g=9.81; % m/s^2

% configure MOSAIC_other_info

% MOSAIC_other_info columns

% 1 - gravity constant m/s^2

% 2 - mass of middle sheet in kg

% 3 - initial tension on spring 6 N

% 4 - initial tension on spring 7 N

% 5 - initial tension on spring 8 N

% 6 - spring 6 spring constant N/mm

% 7 - spring 7 spring constant N/mm

% 8 - spring 8 spring constant N/mm

% 9 - phi_incline

MOSAIC_other_info(1,1:9)=[g,mass,initial_tension_6,...

initial_tension_7, initial_tension_8, k6, k7, k8, phi_incline];

% Load path information

MOSAIC_get_path

current_path=r3_path_6;

% set stored design

stored_design=[0 0 0 0 0 0 0];

stored_design_in_cells=cell(comb_max,1);

%% Step 3 - assign coordinates, solve for the forces, evaluate forces

%loop for checking each combinations

t=tic;

parfor comb_number=1:comb_max

comb_number

% assign geometry

[L1_possibilities,L1_outline] = MOSAIC_Link_1_possibilities_rev_2;

[L3_possibilities,L3_outline] = MOSAIC_Link_3_possibilities_rev_4;

current_combination=combinations_array(comb_number,:);

[MOSAIC_current_geometry_link_1, MOSAIC_current_geometry_link_3]...

=MOSAIC_assign_geometry_rev_2(L1_possibilities,...

L1_outline,L3_possibilities,L1_outline,current_combination);

% determine the forces

evaluated_forces=MOSAIC_Solver_Loop_rev_3(current_path,...

MOSAIC_current_geometry_link_1,MOSAIC_current_geometry_link_3,...

MOSAIC_other_info);

% evaluate if the forces meet the requirements

stored_design_in_cells{comb_number}=...

MOSAIC_check_forces_rev_4(evaluated_forces,comb_number);

25

end % end combination loop

toc(t)

'finished running the parfor loop'

%% Step 4 - post processing of data

t4=tic;

% remove zeros and make cell value empty

cells_of_zeros = cellfun(@(c)...

(isequal(c,[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0])),...

stored_design_in_cells);

stored_design_in_cells(cells_of_zeros) = [];

% remove empty cells

stored_design_in_cells(~cellfun('isempty',stored_design_in_cells));

'finished processing the cells, removed zeros and empties'

toc(t4)

% convert cell to matrix

t2=tic;

stored_design_from_cells=cell2mat(stored_design_in_cells);

'finished converting to a matrix; time is'

toc(t2)

% remove zero rows in matrix

t3=tic;

stored_design_from_cells( ~any(stored_design_from_cells,2), : ) = [];%rows

save rev_15_1_spring_0_05kg_mass_hex_...

path_140x140_9N_PT.out stored_design_from_cells -ASCII

'time to save file'

toc(t3)

'total time'

toc(t)

% End of - MOSAIC_kinematic_forces_main_rev_15.m

26

% % File name - MOSAIC_Solver_Loop_rev_5.m

% Greg Brulo

% MOSAIC Kinematics - this loop solves for the forces and link info at each

% position in the path

% Spring 2017

function evaluated_forces_lengths=MOSAIC_Solver_Loop_rev_5(current_path,...

MOSAIC_current_geometry_link_1,MOSAIC_current_geometry_link_3,...

MOSAIC_other_info,phi_3_input)

global r1A r1B r1C r1D r1E r1F r1G r1H r1I r1J...

r3A r3B r3C r3D r3E r3F r3G r3H r3I r3J...

info

%% step 1 - assign values to variables used here

% current_path columns

% 1 - seq number

% 2 - x position (mm)

% 3 - y position (mm)

% MOSAIC_current_geometry_link_1 columns

% 1 - s1pA

% 2 - s1pC

% 3 - s1pB

% 4 - s1pD

% 5 - s1pI

% 6 - s1pJ

% 7 - s1pE

% 8 - s1pF

% 9 - s1pG

% 10 - s1pH

s1pA=MOSAIC_current_geometry_link_1(:,1);

s1pC=MOSAIC_current_geometry_link_1(:,2);

s1pB=MOSAIC_current_geometry_link_1(:,3);

s1pD=MOSAIC_current_geometry_link_1(:,4);

s1pE=MOSAIC_current_geometry_link_1(:,7);

s1pF=MOSAIC_current_geometry_link_1(:,8);

s1pG=MOSAIC_current_geometry_link_1(:,9);

s1pH=MOSAIC_current_geometry_link_1(:,10);

s1pI=MOSAIC_current_geometry_link_1(:,5);

s1pJ=MOSAIC_current_geometry_link_1(:,6);

s3pA=MOSAIC_current_geometry_link_3(:,1);

s3pC=MOSAIC_current_geometry_link_3(:,2);

s3pB=MOSAIC_current_geometry_link_3(:,3);

s3pD=MOSAIC_current_geometry_link_3(:,4);

s3pE=MOSAIC_current_geometry_link_3(:,7);

s3pF=MOSAIC_current_geometry_link_3(:,8);

s3pG=MOSAIC_current_geometry_link_3(:,9);

s3pH=MOSAIC_current_geometry_link_3(:,10);

s3pI=MOSAIC_current_geometry_link_3(:,5);

s3pJ=MOSAIC_current_geometry_link_3(:,6);

27

% MOSAIC_other_info columns

% 1 - gravity constant m/s^2

% 2 - mass of middle sheet in kg

% 3 - initial tension on spring 6 N

% 4 - initial tension on spring 7 N

% 5 - initial tension on spring 8 N

% 6 - spring 6 spring constant N/mm

% 7 - spring 7 spring constant N/mm

% 8 - spring 8 spring constant N/mm

% 9 - phi_incline

g=MOSAIC_other_info(1,1);

mass=MOSAIC_other_info(1,2);

initial_tension_6=MOSAIC_other_info(1,3);

initial_tension_7=MOSAIC_other_info(1,4);

initial_tension_8=MOSAIC_other_info(1,5);

k6=MOSAIC_other_info(1,6);

k7=MOSAIC_other_info(1,7);

k8=MOSAIC_other_info(1,8);

phi_incline=MOSAIC_other_info(1,9);

d2r=pi/180;

%% step 2 - determine the initial spring lengths

adn=1;

r3_path=current_path;

adn_size=size(r3_path);

adn_max=adn_size(1,1);

info=0;

% set the mechanism to the center and initial lengths to 15 mm

r3_path=[1 0 0];

L6i=15;

L7i=15;

L8i=15;

% solve once

% Describe where the link 3 is relative to link 1

r3=r3_path(adn,2:3)'; % Location of r3 relative to r1

%phi3=0*d2r; % Enter degrees, but store radians

phi3=phi_3_input; % input phi 3 in radians into the function

A3=[cos(phi3) -sin(phi3); sin(phi3) cos(phi3)];% rotation

% matrix

q3=[r3; phi3]; % generalized coordinates for link 3

r1=[0,0]'; % location of global origin

% (should be 0,0)

phi1=0*d2r; % Angle of ground (should be 0)

A1=[cos(phi1) -sin(phi1); sin(phi1) cos(phi1)]; % rotation

% matrix

q1=[r1; phi1]; % generalized coordinates for link 1

% (should be 0,0,0)

% global locations - Eq 2.4.8, page 33 (Dr. Sommer notes)

r1A = r1 + A1*s1pA;

r1B = r1 + A1*s1pB;

r1C = r1 + A1*s1pC;

r1D = r1 + A1*s1pD;

28

r1E = r1 + A1*s1pE;

r1F = r1 + A1*s1pF;

r1G = r1 + A1*s1pG;

r1H = r1 + A1*s1pH;

r1I = r1 + A1*s1pI;

r1J = r1 + A1*s1pJ;

r3A = r3 + A3*s3pA;

r3B = r3 + A3*s3pB;

r3C = r3 + A3*s3pC;

r3D = r3 + A3*s3pD;

r3E = r3 + A3*s3pE;

r3F = r3 + A3*s3pF;

r3G = r3 + A3*s3pG;

r3H = r3 + A3*s3pH;

r3I = r3 + A3*s3pI;

r3J = r3 + A3*s3pJ;

% find the link vectors

% length of wires and direction relative to the frame

D2=r3A-r1A;

D4=r3C-r1C;

D5=r3B-r1B;

D6=r3D-r1D;

D7=r3I-r1I;

D8=r3J-r1J;

% length of the wires from frame to link 3

L2=sqrt(D2(1,1)^2+D2(2,1)^2);

L4=sqrt(D4(1,1)^2+D4(2,1)^2);

L5=sqrt(D5(1,1)^2+D5(2,1)^2);

L6=sqrt(D6(1,1)^2+D6(2,1)^2);

L7=sqrt(D7(1,1)^2+D7(2,1)^2);

L8=sqrt(D8(1,1)^2+D8(2,1)^2);

% angle of the wires relative to the frame

phi2=abs(atan(D2(2,1)/D2(1,1)));

phi4=abs(atan(D4(2,1)/D4(1,1)));

phi5=abs(atan(D5(2,1)/D5(1,1)));

phi6=abs(atan(D6(2,1)/D6(1,1)));

phi7=abs(atan(D7(2,1)/D7(1,1)));

phi8=abs(atan(D8(2,1)/D8(1,1)));

if(D2(1,1)>=0 && D2(2,1)>=0)

% quadrant 1

%'quadrant1'

phi2=phi2;

elseif(D2(1,1)<0 && D2(2,1)>=0)

% quadrant 2

%'quadrant2'

phi2=pi-phi2;

elseif(D2(1,1)<0 && D2(2,1)<0)

% quadrant 3

%'quadrant3'

phi2=pi+phi2;

elseif(D2(1,1)>=0 && D2(2,1)<0)

% quadrant 4

%'quadrant4'

phi2=2*pi-phi2;

else

29

% error

'error1'

end

if(D4(1,1)>=0 && D4(2,1)>=0)

% quadrant 1

%'quadrant1'

phi4=phi4;

elseif(D4(1,1)<0 && D4(2,1)>=0)

% quadrant 2

%'quadrant2'

phi4=pi-phi4;

elseif(D4(1,1)<0 && D4(2,1)<0)

% quadrant 3

%'quadrant3'

phi4=pi+phi4;

elseif(D4(1,1)>=0 && D4(2,1)<0)

% quadrant 4

%'quadrant4'

phi4=2*pi-phi4;

else

%% error

'error2';

end

if(D5(1,1)>=0 && D5(2,1)>=0)

% quadrant 1

%'quadrant1'

phi5=phi5;

elseif(D5(1,1)<0 && D5(2,1)>=0)

% quadrant 2

%'quadrant2'

phi5=pi-phi5;

elseif(D5(1,1)<0 && D5(2,1)<0)

% quadrant 3

%'quadrant3'

phi5=pi+phi5;

elseif(D5(1,1)>=0 && D5(2,1)<0)

% quadrant 4

%'quadrant4'

phi5=2*pi-phi5;

else

% error

'error3'

end

if(D6(1,1)>=0 && D6(2,1)>=0)

% quadrant 1

%'quadrant1'

phi6=phi6;

elseif(D6(1,1)<0 && D6(2,1)>=0)

% quadrant 2

%'quadrant2'

phi6=pi-phi6;

elseif(D6(1,1)<0 && D6(2,1)<0)

% quadrant 3

%'quadrant3'

phi6=pi+phi6;

elseif(D6(1,1)>=0 && D6(2,1)<0)

30

% quadrant 4

%'quadrant4'

phi6=2*pi-phi6;

else

% error

'error4';

end

if(D7(1,1)>=0 && D7(2,1)>=0)

% quadrant 1

%'quadrant1'

phi7=phi7;

elseif(D7(1,1)<0 && D7(2,1)>=0)

% quadrant 2

%'quadrant2'

phi7=pi-phi7;

elseif(D7(1,1)<0 && D7(2,1)<0)

% quadrant 3

%'quadrant3'

phi7=pi+phi7;

elseif(D7(1,1)>=0 && D7(2,1)<0)

% quadrant 4

%'quadrant4'

phi7=2*pi-phi7;

else

% error

'error5'

end

if(D8(1,1)>=0 && D8(2,1)>=0)

% quadrant 1

%'quadrant1'

phi8=phi8;

elseif(D8(1,1)<0 && D8(2,1)>=0)

% quadrant 2

%'quadrant2'

phi8=pi-phi8;

elseif(D8(1,1)<0 && D8(2,1)<0)

% quadrant 3

%'quadrant3'

phi8=pi+phi8;

elseif(D8(1,1)>=0 && D8(2,1)<0)

% quadrant 4

%'quadrant4'

phi8=2*pi-phi8;

else

% error

'error6'

end

% Find the transmission angles

phi2_nominal=0; % radians

phi4_nominal=0; % radians

phi5_nominal=pi/2; % radians

phi6_nominal=pi; % radians

phi7_nominal=0; % radians

phi8_nominal=1.5*pi; % radians

phi2_deviation = phi2/d2r-phi2_nominal/d2r; % degrees

phi4_deviation = phi4/d2r-phi4_nominal/d2r; % degrees

phi5_deviation = phi5/d2r-phi5_nominal/d2r; % degrees

31

phi6_deviation = phi6/d2r-phi6_nominal/d2r; % degrees

phi7_deviation = phi7/d2r-phi7_nominal/d2r; % degrees

phi8_deviation = phi8/d2r-phi8_nominal/d2r; % degrees

% shift transmission angles for easy plotting

if 180<phi2_deviation

phi2_deviation=phi2_deviation-360;

end

if 180<phi4_deviation

phi4_deviation=phi4_deviation-360;

end

if 180<phi5_deviation

phi5_deviation=phi5_deviation-360;

end

if 180<phi6_deviation

phi6_deviation=phi6_deviation-360;

end

if 180<phi7_deviation

phi7_deviation=phi7_deviation-360;

end

if 180<phi8_deviation

phi8_deviation=phi8_deviation-360;

end

theta2=phi2+pi;

theta4=phi4+pi;

theta5=phi5+pi;

theta6=phi6+pi;

theta7=phi7+pi;

theta8=phi8+pi;

% normailize the theta variable terms

while 2*pi<theta2

theta2=theta2-2*pi;

end

while 0>theta2

theta2=theta2+2*pi;

end

while 2*pi<theta4

theta4=theta4-2*pi;

end

while 0>theta4

theta4=theta4+2*pi;

end

while 2*pi<theta5

theta5=theta5-2*pi;

end

while 0>theta5

theta5=theta5+2*pi;

end

while 2*pi<theta6

theta6=theta6-2*pi;

end

while 0>theta6

theta6=theta6+2*pi;

end

while 2*pi<theta7

theta7=theta7-2*pi;

end

while 0>theta7

32

theta7=theta7+2*pi;

end

while 2*pi<theta8

theta8=theta8-2*pi;

end

while 0>theta8

theta8=theta8+2*pi;

end

theta2_degrees=theta2/d2r;

theta4_degrees=theta4/d2r;

theta5_degrees=theta5/d2r;

theta6_degrees=theta6/d2r;

theta7_degrees=theta7/d2r;

theta8_degrees=theta8/d2r;

% Find the forces in the wires

% force due to the weight of the middle sheet

Fw=mass*g*sin(phi_incline);

% solve for F6, F6x, F6y

F6=(L6-L6i)*k6+initial_tension_6;

F6x=F6*cos(theta6);

F6y=F6*sin(theta6);

% solve for F7, F7x, F7y

F7=(L7-L7i)*k7+initial_tension_7;

F7x=F7*cos(theta7);

F7y=F7*sin(theta7);

% solve for F8, F8x, F8y

F8=(L8-L8i)*k8+initial_tension_8;

F8x=F8*cos(theta8);

F8y=F8*sin(theta8);

% solve for F2, F4 and F5

F2 = -(Fw*s3pB(2,1)*cos(theta4)*cos(theta5)...

- Fw*s3pC(2,1)*cos(theta4)*cos(theta5)...

- Fw*s3pB(1,1)*cos(theta4)*sin(theta5)...

+ Fw*s3pC(1,1)*cos(theta5)*sin(theta4)...

- F6*s3pB(2,1)*cos(theta4)*cos(theta5)*sin(theta6)...

+ F6*s3pB(2,1)*cos(theta5)*cos(theta6)*sin(theta4)...

+ F6*s3pC(2,1)*cos(theta4)*cos(theta5)*sin(theta6)...

- F6*s3pC(2,1)*cos(theta4)*cos(theta6)*sin(theta5)...

+ F6*s3pD(2,1)*cos(theta4)*cos(theta6)*sin(theta5)...

- F6*s3pD(2,1)*cos(theta5)*cos(theta6)*sin(theta4)...

- F7*s3pB(2,1)*cos(theta4)*cos(theta5)*sin(theta7)...

+ F7*s3pB(2,1)*cos(theta5)*cos(theta7)*sin(theta4)...

+ F7*s3pC(2,1)*cos(theta4)*cos(theta5)*sin(theta7)...

- F7*s3pC(2,1)*cos(theta4)*cos(theta7)*sin(theta5)...

- F8*s3pB(2,1)*cos(theta4)*cos(theta5)*sin(theta8)...

+ F8*s3pB(2,1)*cos(theta5)*cos(theta8)*sin(theta4)...

+ F8*s3pC(2,1)*cos(theta4)*cos(theta5)*sin(theta8)...

- F8*s3pC(2,1)*cos(theta4)*cos(theta8)*sin(theta5)...

+ F7*s3pI(2,1)*cos(theta4)*cos(theta7)*sin(theta5)...

- F7*s3pI(2,1)*cos(theta5)*cos(theta7)*sin(theta4)...

+ F8*s3pJ(2,1)*cos(theta4)*cos(theta8)*sin(theta5)...

- F8*s3pJ(2,1)*cos(theta5)*cos(theta8)*sin(theta4)...

+ F6*s3pB(1,1)*cos(theta4)*sin(theta5)*sin(theta6)...

- F6*s3pB(1,1)*cos(theta6)*sin(theta4)*sin(theta5)...

33

- F6*s3pC(1,1)*cos(theta5)*sin(theta4)*sin(theta6)...

+ F6*s3pC(1,1)*cos(theta6)*sin(theta4)*sin(theta5)...

- F6*s3pD(1,1)*cos(theta4)*sin(theta5)*sin(theta6)...

+ F6*s3pD(1,1)*cos(theta5)*sin(theta4)*sin(theta6)...

+ F7*s3pB(1,1)*cos(theta4)*sin(theta5)*sin(theta7)...

- F7*s3pB(1,1)*cos(theta7)*sin(theta4)*sin(theta5)...

- F7*s3pC(1,1)*cos(theta5)*sin(theta4)*sin(theta7)...

+ F7*s3pC(1,1)*cos(theta7)*sin(theta4)*sin(theta5)...

+ F8*s3pB(1,1)*cos(theta4)*sin(theta5)*sin(theta8)...

- F8*s3pB(1,1)*cos(theta8)*sin(theta4)*sin(theta5)...

- F8*s3pC(1,1)*cos(theta5)*sin(theta4)*sin(theta8)...

+ F8*s3pC(1,1)*cos(theta8)*sin(theta4)*sin(theta5)...

- F7*s3pI(1,1)*cos(theta4)*sin(theta5)*sin(theta7)...

+ F7*s3pI(1,1)*cos(theta5)*sin(theta4)*sin(theta7)...

- F8*s3pJ(1,1)*cos(theta4)*sin(theta5)*sin(theta8)...

+ F8*s3pJ(1,1)*cos(theta5)*sin(theta4)*sin(theta8))...

/ ...

(s3pA(2,1)*cos(theta2)*cos(theta4)*sin(theta5)...

- s3pA(2,1)*cos(theta2)*cos(theta5)*sin(theta4)...

+ s3pB(2,1)*cos(theta2)*cos(theta5)*sin(theta4)...

- s3pB(2,1)*cos(theta4)*cos(theta5)*sin(theta2)...

- s3pC(2,1)*cos(theta2)*cos(theta4)*sin(theta5)...

+ s3pC(2,1)*cos(theta4)*cos(theta5)*sin(theta2)...

- s3pA(1,1)*cos(theta4)*sin(theta2)*sin(theta5)...

+ s3pA(1,1)*cos(theta5)*sin(theta2)*sin(theta4)...

- s3pB(1,1)*cos(theta2)*sin(theta4)*sin(theta5)...

+ s3pB(1,1)*cos(theta4)*sin(theta2)*sin(theta5)...

+ s3pC(1,1)*cos(theta2)*sin(theta4)*sin(theta5)...

- s3pC(1,1)*cos(theta5)*sin(theta2)*sin(theta4));

F4 = -(Fw*s3pA(2,1)*cos(theta2)*cos(theta5)...

- Fw*s3pB(2,1)*cos(theta2)*cos(theta5)...

- Fw*s3pA(1,1)*cos(theta5)*sin(theta2)...

+ Fw*s3pB(1,1)*cos(theta2)*sin(theta5)...

- F6*s3pA(2,1)*cos(theta2)*cos(theta5)*sin(theta6)...

+ F6*s3pA(2,1)*cos(theta2)*cos(theta6)*sin(theta5)...

+ F6*s3pB(2,1)*cos(theta2)*cos(theta5)*sin(theta6)...

- F6*s3pB(2,1)*cos(theta5)*cos(theta6)*sin(theta2)...

- F7*s3pA(2,1)*cos(theta2)*cos(theta5)*sin(theta7)...

+ F7*s3pA(2,1)*cos(theta2)*cos(theta7)*sin(theta5)...

- F6*s3pD(2,1)*cos(theta2)*cos(theta6)*sin(theta5)...

+ F6*s3pD(2,1)*cos(theta5)*cos(theta6)*sin(theta2)...

+ F7*s3pB(2,1)*cos(theta2)*cos(theta5)*sin(theta7)...

- F7*s3pB(2,1)*cos(theta5)*cos(theta7)*sin(theta2)...

- F8*s3pA(2,1)*cos(theta2)*cos(theta5)*sin(theta8)...

+ F8*s3pA(2,1)*cos(theta2)*cos(theta8)*sin(theta5)...

+ F8*s3pB(2,1)*cos(theta2)*cos(theta5)*sin(theta8)...

- F8*s3pB(2,1)*cos(theta5)*cos(theta8)*sin(theta2)...

- F7*s3pI(2,1)*cos(theta2)*cos(theta7)*sin(theta5)...

+ F7*s3pI(2,1)*cos(theta5)*cos(theta7)*sin(theta2)...

- F8*s3pJ(2,1)*cos(theta2)*cos(theta8)*sin(theta5)...

+ F8*s3pJ(2,1)*cos(theta5)*cos(theta8)*sin(theta2)...

+ F6*s3pA(1,1)*cos(theta5)*sin(theta2)*sin(theta6)...

- F6*s3pA(1,1)*cos(theta6)*sin(theta2)*sin(theta5)...

- F6*s3pB(1,1)*cos(theta2)*sin(theta5)*sin(theta6)...

+ F6*s3pB(1,1)*cos(theta6)*sin(theta2)*sin(theta5)...

+ F7*s3pA(1,1)*cos(theta5)*sin(theta2)*sin(theta7)...

- F7*s3pA(1,1)*cos(theta7)*sin(theta2)*sin(theta5)...

+ F6*s3pD(1,1)*cos(theta2)*sin(theta5)*sin(theta6)...

- F6*s3pD(1,1)*cos(theta5)*sin(theta2)*sin(theta6)...

34

- F7*s3pB(1,1)*cos(theta2)*sin(theta5)*sin(theta7)...

+ F7*s3pB(1,1)*cos(theta7)*sin(theta2)*sin(theta5)...

+ F8*s3pA(1,1)*cos(theta5)*sin(theta2)*sin(theta8)...

- F8*s3pA(1,1)*cos(theta8)*sin(theta2)*sin(theta5)...

- F8*s3pB(1,1)*cos(theta2)*sin(theta5)*sin(theta8)...

+ F8*s3pB(1,1)*cos(theta8)*sin(theta2)*sin(theta5)...

+ F7*s3pI(1,1)*cos(theta2)*sin(theta5)*sin(theta7)...

- F7*s3pI(1,1)*cos(theta5)*sin(theta2)*sin(theta7)...

+ F8*s3pJ(1,1)*cos(theta2)*sin(theta5)*sin(theta8)...

- F8*s3pJ(1,1)*cos(theta5)*sin(theta2)*sin(theta8))...

/...

(s3pA(2,1)*cos(theta2)*cos(theta4)*sin(theta5)...

- s3pA(2,1)*cos(theta2)*cos(theta5)*sin(theta4)...

+ s3pB(2,1)*cos(theta2)*cos(theta5)*sin(theta4)...

- s3pB(2,1)*cos(theta4)*cos(theta5)*sin(theta2)...

- s3pC(2,1)*cos(theta2)*cos(theta4)*sin(theta5)...

+ s3pC(2,1)*cos(theta4)*cos(theta5)*sin(theta2)...

- s3pA(1,1)*cos(theta4)*sin(theta2)*sin(theta5)...

+ s3pA(1,1)*cos(theta5)*sin(theta2)*sin(theta4)...

- s3pB(1,1)*cos(theta2)*sin(theta4)*sin(theta5)...

+ s3pB(1,1)*cos(theta4)*sin(theta2)*sin(theta5)...

+ s3pC(1,1)*cos(theta2)*sin(theta4)*sin(theta5)...

- s3pC(1,1)*cos(theta5)*sin(theta2)*sin(theta4));

F5 = (Fw*s3pA(2,1)*cos(theta2)*cos(theta4)...

- Fw*s3pC(2,1)*cos(theta2)*cos(theta4)...

- Fw*s3pA(1,1)*cos(theta4)*sin(theta2)...

+ Fw*s3pC(1,1)*cos(theta2)*sin(theta4)...

- F6*s3pA(2,1)*cos(theta2)*cos(theta4)*sin(theta6)...

+ F6*s3pA(2,1)*cos(theta2)*cos(theta6)*sin(theta4)...

+ F6*s3pC(2,1)*cos(theta2)*cos(theta4)*sin(theta6)...

- F6*s3pC(2,1)*cos(theta4)*cos(theta6)*sin(theta2)...

- F7*s3pA(2,1)*cos(theta2)*cos(theta4)*sin(theta7)...

+ F7*s3pA(2,1)*cos(theta2)*cos(theta7)*sin(theta4)...

- F6*s3pD(2,1)*cos(theta2)*cos(theta6)*sin(theta4)...

+ F6*s3pD(2,1)*cos(theta4)*cos(theta6)*sin(theta2)...

+ F7*s3pC(2,1)*cos(theta2)*cos(theta4)*sin(theta7)...

- F7*s3pC(2,1)*cos(theta4)*cos(theta7)*sin(theta2)...

- F8*s3pA(2,1)*cos(theta2)*cos(theta4)*sin(theta8)...

+ F8*s3pA(2,1)*cos(theta2)*cos(theta8)*sin(theta4)...

+ F8*s3pC(2,1)*cos(theta2)*cos(theta4)*sin(theta8)...

- F8*s3pC(2,1)*cos(theta4)*cos(theta8)*sin(theta2)...

- F7*s3pI(2,1)*cos(theta2)*cos(theta7)*sin(theta4)...

+ F7*s3pI(2,1)*cos(theta4)*cos(theta7)*sin(theta2)...

- F8*s3pJ(2,1)*cos(theta2)*cos(theta8)*sin(theta4)...

+ F8*s3pJ(2,1)*cos(theta4)*cos(theta8)*sin(theta2)...

+ F6*s3pA(1,1)*cos(theta4)*sin(theta2)*sin(theta6)...

- F6*s3pA(1,1)*cos(theta6)*sin(theta2)*sin(theta4)...

- F6*s3pC(1,1)*cos(theta2)*sin(theta4)*sin(theta6)...

+ F6*s3pC(1,1)*cos(theta6)*sin(theta2)*sin(theta4)...

+ F7*s3pA(1,1)*cos(theta4)*sin(theta2)*sin(theta7)...

- F7*s3pA(1,1)*cos(theta7)*sin(theta2)*sin(theta4)...

+ F6*s3pD(1,1)*cos(theta2)*sin(theta4)*sin(theta6)...

- F6*s3pD(1,1)*cos(theta4)*sin(theta2)*sin(theta6)...

- F7*s3pC(1,1)*cos(theta2)*sin(theta4)*sin(theta7)...

+ F7*s3pC(1,1)*cos(theta7)*sin(theta2)*sin(theta4)...

+ F8*s3pA(1,1)*cos(theta4)*sin(theta2)*sin(theta8)...

- F8*s3pA(1,1)*cos(theta8)*sin(theta2)*sin(theta4)...

- F8*s3pC(1,1)*cos(theta2)*sin(theta4)*sin(theta8)...

+ F8*s3pC(1,1)*cos(theta8)*sin(theta2)*sin(theta4)...

+ F7*s3pI(1,1)*cos(theta2)*sin(theta4)*sin(theta7)...

35

- F7*s3pI(1,1)*cos(theta4)*sin(theta2)*sin(theta7)...

+ F8*s3pJ(1,1)*cos(theta2)*sin(theta4)*sin(theta8)...

- F8*s3pJ(1,1)*cos(theta4)*sin(theta2)*sin(theta8))...

/...

(s3pA(2,1)*cos(theta2)*cos(theta4)*sin(theta5)...

- s3pA(2,1)*cos(theta2)*cos(theta5)*sin(theta4)...

+ s3pB(2,1)*cos(theta2)*cos(theta5)*sin(theta4)...

- s3pB(2,1)*cos(theta4)*cos(theta5)*sin(theta2)...

- s3pC(2,1)*cos(theta2)*cos(theta4)*sin(theta5)...

+ s3pC(2,1)*cos(theta4)*cos(theta5)*sin(theta2)...

- s3pA(1,1)*cos(theta4)*sin(theta2)*sin(theta5)...

+ s3pA(1,1)*cos(theta5)*sin(theta2)*sin(theta4)...

- s3pB(1,1)*cos(theta2)*sin(theta4)*sin(theta5)...

+ s3pB(1,1)*cos(theta4)*sin(theta2)*sin(theta5)...

+ s3pC(1,1)*cos(theta2)*sin(theta4)*sin(theta5)...

- s3pC(1,1)*cos(theta5)*sin(theta2)*sin(theta4));

F2_denominator=...

(s3pA(2,1)*cos(theta2)*cos(theta4)*sin(theta5)...

- s3pA(2,1)*cos(theta2)*cos(theta5)*sin(theta4)...

+ s3pB(2,1)*cos(theta2)*cos(theta5)*sin(theta4)...

- s3pB(2,1)*cos(theta4)*cos(theta5)*sin(theta2)...

- s3pC(2,1)*cos(theta2)*cos(theta4)*sin(theta5)...

+ s3pC(2,1)*cos(theta4)*cos(theta5)*sin(theta2)...

- s3pA(1,1)*cos(theta4)*sin(theta2)*sin(theta5)...

+ s3pA(1,1)*cos(theta5)*sin(theta2)*sin(theta4)...

- s3pB(1,1)*cos(theta2)*sin(theta4)*sin(theta5)...

+ s3pB(1,1)*cos(theta4)*sin(theta2)*sin(theta5)...

+ s3pC(1,1)*cos(theta2)*sin(theta4)*sin(theta5)...

- s3pC(1,1)*cos(theta5)*sin(theta2)*sin(theta4));

F4_denominator=...

(s3pA(2,1)*cos(theta2)*cos(theta4)*sin(theta5)...

- s3pA(2,1)*cos(theta2)*cos(theta5)*sin(theta4)...

+ s3pB(2,1)*cos(theta2)*cos(theta5)*sin(theta4)...

- s3pB(2,1)*cos(theta4)*cos(theta5)*sin(theta2)...

- s3pC(2,1)*cos(theta2)*cos(theta4)*sin(theta5)...

+ s3pC(2,1)*cos(theta4)*cos(theta5)*sin(theta2)...

- s3pA(1,1)*cos(theta4)*sin(theta2)*sin(theta5)...

+ s3pA(1,1)*cos(theta5)*sin(theta2)*sin(theta4)...

- s3pB(1,1)*cos(theta2)*sin(theta4)*sin(theta5)...

+ s3pB(1,1)*cos(theta4)*sin(theta2)*sin(theta5)...

+ s3pC(1,1)*cos(theta2)*sin(theta4)*sin(theta5)...

- s3pC(1,1)*cos(theta5)*sin(theta2)*sin(theta4));

F5_denominator =...

(s3pA(2,1)*cos(theta2)*cos(theta4)*sin(theta5)...

- s3pA(2,1)*cos(theta2)*cos(theta5)*sin(theta4)...

+ s3pB(2,1)*cos(theta2)*cos(theta5)*sin(theta4)...

- s3pB(2,1)*cos(theta4)*cos(theta5)*sin(theta2)...

- s3pC(2,1)*cos(theta2)*cos(theta4)*sin(theta5)...

+ s3pC(2,1)*cos(theta4)*cos(theta5)*sin(theta2)...

- s3pA(1,1)*cos(theta4)*sin(theta2)*sin(theta5)...

+ s3pA(1,1)*cos(theta5)*sin(theta2)*sin(theta4)...

- s3pB(1,1)*cos(theta2)*sin(theta4)*sin(theta5)...

+ s3pB(1,1)*cos(theta4)*sin(theta2)*sin(theta5)...

+ s3pC(1,1)*cos(theta2)*sin(theta4)*sin(theta5)...

- s3pC(1,1)*cos(theta5)*sin(theta2)*sin(theta4));

F2x=F2*cos(theta2);

F2y=F2*sin(theta2);

36

F4x=F4*cos(theta4);

F4y=F4*sin(theta4);

F5x=F5*cos(theta5);

F5y=F5*sin(theta5);

% the following status variables are no longer used but kept

% for simplicity of variable column conventions

F2_status=0;

F4_status=0;

F5_status=0;

% Store information

info(adn,1:40)=[adn,...

r3(1,1),...

r3(2,1),...

phi3,...

L2,...

phi2,...

L4,...

phi4,...

L5,...

phi5,...

L6,...

phi6,...

phi2_deviation,...

phi4_deviation,...

phi5_deviation,...

phi6_deviation,...

F2x,...

F2y,...

F4x,...

F4y,...

F5x,...

F5y,...

F6x,...

F6y,...

F7x,...

F7y,...

F8x,...

F8y,...

F2,...

F4,...

F5,...

F6,...

F7,...

F8,...

F2_status,...

F4_status,...

F5_status,...

F2_denominator,...

F4_denominator,...

F5_denominator];

% info columns

% 1 - adn

% 2 - r3x - global - mm

% 3 - r3y - global - mm

% 4 - phi3 - radians

% 5 - L2 - mm

% 6 - phi 2 - radians

% 7 - L4 - mm

37

% 8 - phi 4 - radians

% 9 - L5 - mm

% 10 - phi 5 - radians

% 11 - L6 - mm

% 12 - phi 6 - radians

% 13 - Phi2 Deviation

% 14 - Phi4 Deviation

% 15 - Phi5 Deviation

% 16 - Phi6 Deviation

% 17 - F2x

% 18 - F2y

% 19 - F4x

% 20 - F4y

% 21 - F5x

% 22 - F5y

% 23 - F6x

% 24 - F6y

% 25 - F7x

% 26 - F7y

% 27 - F8x

% 28 - F8y

% 29 - F2

% 30 - F4

% 31 - F5

% 32 - F6

% 33 - F7

% 34 - F8

% 35 - F2_status

% 36 - F4_status

% 37 - F5_status

% 38 - F2_denominator

% 39 - F4_denominator

% 40 - F5_denominator

% set the initial spring lengths

L6i=L6;

L7i=L7;

L8i=L8;

% set the initial lengths of the actuator wires

L2i=L2;

L4i=L4;

L5i=L5;

%% step 3 - run loop to solve forces at each point in the path

r3_path=current_path;

while adn<=adn_max

%adn % display adn value

% Describe where the link 3 is relative to link 1

r3=r3_path(adn,2:3)'; % Location of r3 relative to r1

%phi3=0*d2r; % Enter degrees, but store radians

phi3=phi_3_input; % enter phi 3 in radians using function input

A3=[cos(phi3) -sin(phi3); sin(phi3) cos(phi3)]; % rotation matrix

q3=[r3; phi3]; % generalized coordinates for link 3

r1=[0,0]'; % location of global origin (should be 0,0)

phi1=0*d2r; % Angle of ground (should be 0)

A1=[cos(phi1) -sin(phi1); sin(phi1) cos(phi1)]; % rotation matrix

38

q1=[r1; phi1]; % generalized coordinates for link 1

% (should be 0,0,0)

% global locations - Eq 2.4.8, page 33 (Dr. Sommer)

r1A = r1 + A1*s1pA;

r1B = r1 + A1*s1pB;

r1C = r1 + A1*s1pC;

r1D = r1 + A1*s1pD;

r1E = r1 + A1*s1pE;

r1F = r1 + A1*s1pF;

r1G = r1 + A1*s1pG;

r1H = r1 + A1*s1pH;

r1I = r1 + A1*s1pI;

r1J = r1 + A1*s1pJ;

r3A = r3 + A3*s3pA;

r3B = r3 + A3*s3pB;

r3C = r3 + A3*s3pC;

r3D = r3 + A3*s3pD;

r3E = r3 + A3*s3pE;

r3F = r3 + A3*s3pF;

r3G = r3 + A3*s3pG;

r3H = r3 + A3*s3pH;

r3I = r3 + A3*s3pI;

r3J = r3 + A3*s3pJ;

% find the link vectors

% length of wires and direction relative to the frame

D2=r3A-r1A;

D4=r3C-r1C;

D5=r3B-r1B;

D6=r3D-r1D;

D7=r3I-r1I;

D8=r3J-r1J;

% length of the wires from frame to link 3

L2=sqrt(D2(1,1)^2+D2(2,1)^2);

L4=sqrt(D4(1,1)^2+D4(2,1)^2);

L5=sqrt(D5(1,1)^2+D5(2,1)^2);

L6=sqrt(D6(1,1)^2+D6(2,1)^2);

L7=sqrt(D7(1,1)^2+D7(2,1)^2);

L8=sqrt(D8(1,1)^2+D8(2,1)^2);

% angle of the wires relative to the frame

phi2=abs(atan(D2(2,1)/D2(1,1)));

phi4=abs(atan(D4(2,1)/D4(1,1)));

phi5=abs(atan(D5(2,1)/D5(1,1)));

phi6=abs(atan(D6(2,1)/D6(1,1)));

phi7=abs(atan(D7(2,1)/D7(1,1)));

phi8=abs(atan(D8(2,1)/D8(1,1)));

if(D2(1,1)>=0 && D2(2,1)>=0)

% quadrant 1

%'quadrant1'

phi2=phi2;

elseif(D2(1,1)<0 && D2(2,1)>=0)

% quadrant 2

%'quadrant2'

phi2=pi-phi2;

39

elseif(D2(1,1)<0 && D2(2,1)<0)

% quadrant 3

%'quadrant3'

phi2=pi+phi2;

elseif(D2(1,1)>=0 && D2(2,1)<0)

% quadrant 4

%'quadrant4'

phi2=2*pi-phi2;

else

% error

'error1'

end

if(D4(1,1)>=0 && D4(2,1)>=0)

% quadrant 1

%'quadrant1'

phi4=phi4;

elseif(D4(1,1)<0 && D4(2,1)>=0)

% quadrant 2

%'quadrant2'

phi4=pi-phi4;

elseif(D4(1,1)<0 && D4(2,1)<0)

% quadrant 3

%'quadrant3'

phi4=pi+phi4;

elseif(D4(1,1)>=0 && D4(2,1)<0)

% quadrant 4

%'quadrant4'

phi4=2*pi-phi4;

else

%% error

'error2'

end

if(D5(1,1)>=0 && D5(2,1)>=0)

% quadrant 1

%'quadrant1'

phi5=phi5;

elseif(D5(1,1)<0 && D5(2,1)>=0)

% quadrant 2

%'quadrant2'

phi5=pi-phi5;

elseif(D5(1,1)<0 && D5(2,1)<0)

% quadrant 3

%'quadrant3'

phi5=pi+phi5;

elseif(D5(1,1)>=0 && D5(2,1)<0)

% quadrant 4

%'quadrant4'

phi5=2*pi-phi5;

else

% error

'error3'

end

if(D6(1,1)>=0 && D6(2,1)>=0)

% quadrant 1

%'quadrant1'

phi6=phi6;

40

elseif(D6(1,1)<0 && D6(2,1)>=0)

% quadrant 2

%'quadrant2'

phi6=pi-phi6;

elseif(D6(1,1)<0 && D6(2,1)<0)

% quadrant 3

%'quadrant3'

phi6=pi+phi6;

elseif(D6(1,1)>=0 && D6(2,1)<0)

% quadrant 4

%'quadrant4'

phi6=2*pi-phi6;

else

% error

'error4'

end

if(D7(1,1)>=0 && D7(2,1)>=0)

% quadrant 1

%'quadrant1'

phi7=phi7;

elseif(D7(1,1)<0 && D7(2,1)>=0)

% quadrant 2

%'quadrant2'

phi7=pi-phi7;

elseif(D7(1,1)<0 && D7(2,1)<0)

% quadrant 3

%'quadrant3'

phi7=pi+phi7;

elseif(D7(1,1)>=0 && D7(2,1)<0)

% quadrant 4

%'quadrant4'

phi7=2*pi-phi7;

else

% error

'error5'

end

if(D8(1,1)>=0 && D8(2,1)>=0)

% quadrant 1

%'quadrant1'

phi8=phi8;

elseif(D8(1,1)<0 && D8(2,1)>=0)

% quadrant 2

%'quadrant2'

phi8=pi-phi8;

elseif(D8(1,1)<0 && D8(2,1)<0)

% quadrant 3

%'quadrant3'

phi8=pi+phi8;

elseif(D8(1,1)>=0 && D8(2,1)<0)

% quadrant 4

%'quadrant4'

phi8=2*pi-phi8;

else

% error

'error6'

end

% Find the transmission angles

phi2_nominal=0; % radians

41

phi4_nominal=0; % radians

phi5_nominal=pi/2; % radians

phi6_nominal=pi; % radians

phi7_nominal=0; % radians

phi8_nominal=1.5*pi; % radians

phi2_deviation = phi2/d2r-phi2_nominal/d2r; % degrees

phi4_deviation = phi4/d2r-phi4_nominal/d2r; % degrees

phi5_deviation = phi5/d2r-phi5_nominal/d2r; % degrees

phi6_deviation = phi6/d2r-phi6_nominal/d2r; % degrees

phi7_deviation = phi7/d2r-phi7_nominal/d2r; % degrees

phi8_deviation = phi8/d2r-phi8_nominal/d2r; % degrees

% shift transmission angles for easy plotting

if 180<phi2_deviation

phi2_deviation=phi2_deviation-360;

end

if 180<phi4_deviation

phi4_deviation=phi4_deviation-360;

end

if 180<phi5_deviation

phi5_deviation=phi5_deviation-360;

end

if 180<phi6_deviation

phi6_deviation=phi6_deviation-360;

end

if 180<phi7_deviation

phi7_deviation=phi7_deviation-360;

end

if 180<phi8_deviation

phi8_deviation=phi8_deviation-360;

end

theta2=phi2+pi;

theta4=phi4+pi;

theta5=phi5+pi;

theta6=phi6+pi;

theta7=phi7+pi;

theta8=phi8+pi;

% normailize the theta variable terms

while 2*pi<theta2

theta2=theta2-2*pi;

end

while 0>theta2

theta2=theta2+2*pi;

end

while 2*pi<theta4

theta4=theta4-2*pi;

end

while 0>theta4

theta4=theta4+2*pi;

end

while 2*pi<theta5

theta5=theta5-2*pi;

end

while 0>theta5

theta5=theta5+2*pi;

end

while 2*pi<theta6

42

theta6=theta6-2*pi;

end

while 0>theta6

theta6=theta6+2*pi;

end

while 2*pi<theta7

theta7=theta7-2*pi;

end

while 0>theta7

theta7=theta7+2*pi;

end

while 2*pi<theta8

theta8=theta8-2*pi;

end

while 0>theta8

theta8=theta8+2*pi;

end

theta2_degrees=theta2/d2r;

theta4_degrees=theta4/d2r;

theta5_degrees=theta5/d2r;

theta6_degrees=theta6/d2r;

theta7_degrees=theta7/d2r;

theta8_degrees=theta8/d2r;

% Find the forces in the wires

% force due to the weight of the middle sheet

Fw=mass*g*sin(phi_incline);

% solve for F6, F6x, F6y

F6=(L6-L6i)*k6+initial_tension_6;

F6x=F6*cos(theta6);

F6y=F6*sin(theta6);

% solve for F7, F7x, F7y

F7=(L7-L7i)*k7+initial_tension_7;

F7x=F7*cos(theta7);

F7y=F7*sin(theta7);

% solve for F8, F8x, F8y

F8=(L8-L8i)*k8+initial_tension_8;

F8x=F8*cos(theta8);

F8y=F8*sin(theta8);

% solve for F2, F4 and F5

F2 = -(Fw*s3pB(2,1)*cos(theta4)*cos(theta5)...

- Fw*s3pC(2,1)*cos(theta4)*cos(theta5)...

- Fw*s3pB(1,1)*cos(theta4)*sin(theta5)...

+ Fw*s3pC(1,1)*cos(theta5)*sin(theta4)...

- F6*s3pB(2,1)*cos(theta4)*cos(theta5)*sin(theta6)...

+ F6*s3pB(2,1)*cos(theta5)*cos(theta6)*sin(theta4)...

+ F6*s3pC(2,1)*cos(theta4)*cos(theta5)*sin(theta6)...

- F6*s3pC(2,1)*cos(theta4)*cos(theta6)*sin(theta5)...

+ F6*s3pD(2,1)*cos(theta4)*cos(theta6)*sin(theta5)...

- F6*s3pD(2,1)*cos(theta5)*cos(theta6)*sin(theta4)...

- F7*s3pB(2,1)*cos(theta4)*cos(theta5)*sin(theta7)...

+ F7*s3pB(2,1)*cos(theta5)*cos(theta7)*sin(theta4)...

+ F7*s3pC(2,1)*cos(theta4)*cos(theta5)*sin(theta7)...

- F7*s3pC(2,1)*cos(theta4)*cos(theta7)*sin(theta5)...

- F8*s3pB(2,1)*cos(theta4)*cos(theta5)*sin(theta8)...

43

+ F8*s3pB(2,1)*cos(theta5)*cos(theta8)*sin(theta4)...

+ F8*s3pC(2,1)*cos(theta4)*cos(theta5)*sin(theta8)...

- F8*s3pC(2,1)*cos(theta4)*cos(theta8)*sin(theta5)...

+ F7*s3pI(2,1)*cos(theta4)*cos(theta7)*sin(theta5)...

- F7*s3pI(2,1)*cos(theta5)*cos(theta7)*sin(theta4)...

+ F8*s3pJ(2,1)*cos(theta4)*cos(theta8)*sin(theta5)...

- F8*s3pJ(2,1)*cos(theta5)*cos(theta8)*sin(theta4)...

+ F6*s3pB(1,1)*cos(theta4)*sin(theta5)*sin(theta6)...

- F6*s3pB(1,1)*cos(theta6)*sin(theta4)*sin(theta5)...

- F6*s3pC(1,1)*cos(theta5)*sin(theta4)*sin(theta6)...

+ F6*s3pC(1,1)*cos(theta6)*sin(theta4)*sin(theta5)...

- F6*s3pD(1,1)*cos(theta4)*sin(theta5)*sin(theta6)...

+ F6*s3pD(1,1)*cos(theta5)*sin(theta4)*sin(theta6)...

+ F7*s3pB(1,1)*cos(theta4)*sin(theta5)*sin(theta7)...

- F7*s3pB(1,1)*cos(theta7)*sin(theta4)*sin(theta5)...

- F7*s3pC(1,1)*cos(theta5)*sin(theta4)*sin(theta7)...

+ F7*s3pC(1,1)*cos(theta7)*sin(theta4)*sin(theta5)...

+ F8*s3pB(1,1)*cos(theta4)*sin(theta5)*sin(theta8)...

- F8*s3pB(1,1)*cos(theta8)*sin(theta4)*sin(theta5)...

- F8*s3pC(1,1)*cos(theta5)*sin(theta4)*sin(theta8)...

+ F8*s3pC(1,1)*cos(theta8)*sin(theta4)*sin(theta5)...

- F7*s3pI(1,1)*cos(theta4)*sin(theta5)*sin(theta7)...

+ F7*s3pI(1,1)*cos(theta5)*sin(theta4)*sin(theta7)...

- F8*s3pJ(1,1)*cos(theta4)*sin(theta5)*sin(theta8)...

+ F8*s3pJ(1,1)*cos(theta5)*sin(theta4)*sin(theta8))...

/ ...

(s3pA(2,1)*cos(theta2)*cos(theta4)*sin(theta5)...

- s3pA(2,1)*cos(theta2)*cos(theta5)*sin(theta4)...

+ s3pB(2,1)*cos(theta2)*cos(theta5)*sin(theta4)...

- s3pB(2,1)*cos(theta4)*cos(theta5)*sin(theta2)...

- s3pC(2,1)*cos(theta2)*cos(theta4)*sin(theta5)...

+ s3pC(2,1)*cos(theta4)*cos(theta5)*sin(theta2)...

- s3pA(1,1)*cos(theta4)*sin(theta2)*sin(theta5)...

+ s3pA(1,1)*cos(theta5)*sin(theta2)*sin(theta4)...

- s3pB(1,1)*cos(theta2)*sin(theta4)*sin(theta5)...

+ s3pB(1,1)*cos(theta4)*sin(theta2)*sin(theta5)...

+ s3pC(1,1)*cos(theta2)*sin(theta4)*sin(theta5)...

- s3pC(1,1)*cos(theta5)*sin(theta2)*sin(theta4));

F4 = -(Fw*s3pA(2,1)*cos(theta2)*cos(theta5)...

- Fw*s3pB(2,1)*cos(theta2)*cos(theta5)...

- Fw*s3pA(1,1)*cos(theta5)*sin(theta2)...

+ Fw*s3pB(1,1)*cos(theta2)*sin(theta5)...

- F6*s3pA(2,1)*cos(theta2)*cos(theta5)*sin(theta6)...

+ F6*s3pA(2,1)*cos(theta2)*cos(theta6)*sin(theta5)...

+ F6*s3pB(2,1)*cos(theta2)*cos(theta5)*sin(theta6)...

- F6*s3pB(2,1)*cos(theta5)*cos(theta6)*sin(theta2)...

- F7*s3pA(2,1)*cos(theta2)*cos(theta5)*sin(theta7)...

+ F7*s3pA(2,1)*cos(theta2)*cos(theta7)*sin(theta5)...

- F6*s3pD(2,1)*cos(theta2)*cos(theta6)*sin(theta5)...

+ F6*s3pD(2,1)*cos(theta5)*cos(theta6)*sin(theta2)...

+ F7*s3pB(2,1)*cos(theta2)*cos(theta5)*sin(theta7)...

- F7*s3pB(2,1)*cos(theta5)*cos(theta7)*sin(theta2)...

- F8*s3pA(2,1)*cos(theta2)*cos(theta5)*sin(theta8)...

+ F8*s3pA(2,1)*cos(theta2)*cos(theta8)*sin(theta5)...

+ F8*s3pB(2,1)*cos(theta2)*cos(theta5)*sin(theta8)...

- F8*s3pB(2,1)*cos(theta5)*cos(theta8)*sin(theta2)...

- F7*s3pI(2,1)*cos(theta2)*cos(theta7)*sin(theta5)...

+ F7*s3pI(2,1)*cos(theta5)*cos(theta7)*sin(theta2)...

- F8*s3pJ(2,1)*cos(theta2)*cos(theta8)*sin(theta5)...

44

+ F8*s3pJ(2,1)*cos(theta5)*cos(theta8)*sin(theta2)...

+ F6*s3pA(1,1)*cos(theta5)*sin(theta2)*sin(theta6)...

- F6*s3pA(1,1)*cos(theta6)*sin(theta2)*sin(theta5)...

- F6*s3pB(1,1)*cos(theta2)*sin(theta5)*sin(theta6)...

+ F6*s3pB(1,1)*cos(theta6)*sin(theta2)*sin(theta5)...

+ F7*s3pA(1,1)*cos(theta5)*sin(theta2)*sin(theta7)...

- F7*s3pA(1,1)*cos(theta7)*sin(theta2)*sin(theta5)...

+ F6*s3pD(1,1)*cos(theta2)*sin(theta5)*sin(theta6)...

- F6*s3pD(1,1)*cos(theta5)*sin(theta2)*sin(theta6)...

- F7*s3pB(1,1)*cos(theta2)*sin(theta5)*sin(theta7)...

+ F7*s3pB(1,1)*cos(theta7)*sin(theta2)*sin(theta5)...

+ F8*s3pA(1,1)*cos(theta5)*sin(theta2)*sin(theta8)...

- F8*s3pA(1,1)*cos(theta8)*sin(theta2)*sin(theta5)...

- F8*s3pB(1,1)*cos(theta2)*sin(theta5)*sin(theta8)...

+ F8*s3pB(1,1)*cos(theta8)*sin(theta2)*sin(theta5)...

+ F7*s3pI(1,1)*cos(theta2)*sin(theta5)*sin(theta7)...

- F7*s3pI(1,1)*cos(theta5)*sin(theta2)*sin(theta7)...

+ F8*s3pJ(1,1)*cos(theta2)*sin(theta5)*sin(theta8)...

- F8*s3pJ(1,1)*cos(theta5)*sin(theta2)*sin(theta8))...

/...

(s3pA(2,1)*cos(theta2)*cos(theta4)*sin(theta5)...

- s3pA(2,1)*cos(theta2)*cos(theta5)*sin(theta4)...

+ s3pB(2,1)*cos(theta2)*cos(theta5)*sin(theta4)...

- s3pB(2,1)*cos(theta4)*cos(theta5)*sin(theta2)...

- s3pC(2,1)*cos(theta2)*cos(theta4)*sin(theta5)...

+ s3pC(2,1)*cos(theta4)*cos(theta5)*sin(theta2)...

- s3pA(1,1)*cos(theta4)*sin(theta2)*sin(theta5)...

+ s3pA(1,1)*cos(theta5)*sin(theta2)*sin(theta4)...

- s3pB(1,1)*cos(theta2)*sin(theta4)*sin(theta5)...

+ s3pB(1,1)*cos(theta4)*sin(theta2)*sin(theta5)...

+ s3pC(1,1)*cos(theta2)*sin(theta4)*sin(theta5)...

- s3pC(1,1)*cos(theta5)*sin(theta2)*sin(theta4));

F5 = (Fw*s3pA(2,1)*cos(theta2)*cos(theta4)...

- Fw*s3pC(2,1)*cos(theta2)*cos(theta4)...

- Fw*s3pA(1,1)*cos(theta4)*sin(theta2)...

+ Fw*s3pC(1,1)*cos(theta2)*sin(theta4)...

- F6*s3pA(2,1)*cos(theta2)*cos(theta4)*sin(theta6)...

+ F6*s3pA(2,1)*cos(theta2)*cos(theta6)*sin(theta4)...

+ F6*s3pC(2,1)*cos(theta2)*cos(theta4)*sin(theta6)...

- F6*s3pC(2,1)*cos(theta4)*cos(theta6)*sin(theta2)...

- F7*s3pA(2,1)*cos(theta2)*cos(theta4)*sin(theta7)...

+ F7*s3pA(2,1)*cos(theta2)*cos(theta7)*sin(theta4)...

- F6*s3pD(2,1)*cos(theta2)*cos(theta6)*sin(theta4)...

+ F6*s3pD(2,1)*cos(theta4)*cos(theta6)*sin(theta2)...

+ F7*s3pC(2,1)*cos(theta2)*cos(theta4)*sin(theta7)...

- F7*s3pC(2,1)*cos(theta4)*cos(theta7)*sin(theta2)...

- F8*s3pA(2,1)*cos(theta2)*cos(theta4)*sin(theta8)...

+ F8*s3pA(2,1)*cos(theta2)*cos(theta8)*sin(theta4)...

+ F8*s3pC(2,1)*cos(theta2)*cos(theta4)*sin(theta8)...

- F8*s3pC(2,1)*cos(theta4)*cos(theta8)*sin(theta2)...

- F7*s3pI(2,1)*cos(theta2)*cos(theta7)*sin(theta4)...

+ F7*s3pI(2,1)*cos(theta4)*cos(theta7)*sin(theta2)...

- F8*s3pJ(2,1)*cos(theta2)*cos(theta8)*sin(theta4)...

+ F8*s3pJ(2,1)*cos(theta4)*cos(theta8)*sin(theta2)...

+ F6*s3pA(1,1)*cos(theta4)*sin(theta2)*sin(theta6)...

- F6*s3pA(1,1)*cos(theta6)*sin(theta2)*sin(theta4)...

- F6*s3pC(1,1)*cos(theta2)*sin(theta4)*sin(theta6)...

+ F6*s3pC(1,1)*cos(theta6)*sin(theta2)*sin(theta4)...

+ F7*s3pA(1,1)*cos(theta4)*sin(theta2)*sin(theta7)...

- F7*s3pA(1,1)*cos(theta7)*sin(theta2)*sin(theta4)...

45

+ F6*s3pD(1,1)*cos(theta2)*sin(theta4)*sin(theta6)...

- F6*s3pD(1,1)*cos(theta4)*sin(theta2)*sin(theta6)...

- F7*s3pC(1,1)*cos(theta2)*sin(theta4)*sin(theta7)...

+ F7*s3pC(1,1)*cos(theta7)*sin(theta2)*sin(theta4)...

+ F8*s3pA(1,1)*cos(theta4)*sin(theta2)*sin(theta8)...

- F8*s3pA(1,1)*cos(theta8)*sin(theta2)*sin(theta4)...

- F8*s3pC(1,1)*cos(theta2)*sin(theta4)*sin(theta8)...

+ F8*s3pC(1,1)*cos(theta8)*sin(theta2)*sin(theta4)...

+ F7*s3pI(1,1)*cos(theta2)*sin(theta4)*sin(theta7)...

- F7*s3pI(1,1)*cos(theta4)*sin(theta2)*sin(theta7)...

+ F8*s3pJ(1,1)*cos(theta2)*sin(theta4)*sin(theta8)...

- F8*s3pJ(1,1)*cos(theta4)*sin(theta2)*sin(theta8))...

/...

(s3pA(2,1)*cos(theta2)*cos(theta4)*sin(theta5)...

- s3pA(2,1)*cos(theta2)*cos(theta5)*sin(theta4)...

+ s3pB(2,1)*cos(theta2)*cos(theta5)*sin(theta4)...

- s3pB(2,1)*cos(theta4)*cos(theta5)*sin(theta2)...

- s3pC(2,1)*cos(theta2)*cos(theta4)*sin(theta5)...

+ s3pC(2,1)*cos(theta4)*cos(theta5)*sin(theta2)...

- s3pA(1,1)*cos(theta4)*sin(theta2)*sin(theta5)...

+ s3pA(1,1)*cos(theta5)*sin(theta2)*sin(theta4)...

- s3pB(1,1)*cos(theta2)*sin(theta4)*sin(theta5)...

+ s3pB(1,1)*cos(theta4)*sin(theta2)*sin(theta5)...

+ s3pC(1,1)*cos(theta2)*sin(theta4)*sin(theta5)...

- s3pC(1,1)*cos(theta5)*sin(theta2)*sin(theta4));

F2_denominator=...

(s3pA(2,1)*cos(theta2)*cos(theta4)*sin(theta5)...

- s3pA(2,1)*cos(theta2)*cos(theta5)*sin(theta4)...

+ s3pB(2,1)*cos(theta2)*cos(theta5)*sin(theta4)...

- s3pB(2,1)*cos(theta4)*cos(theta5)*sin(theta2)...

- s3pC(2,1)*cos(theta2)*cos(theta4)*sin(theta5)...

+ s3pC(2,1)*cos(theta4)*cos(theta5)*sin(theta2)...

- s3pA(1,1)*cos(theta4)*sin(theta2)*sin(theta5)...

+ s3pA(1,1)*cos(theta5)*sin(theta2)*sin(theta4)...

- s3pB(1,1)*cos(theta2)*sin(theta4)*sin(theta5)...

+ s3pB(1,1)*cos(theta4)*sin(theta2)*sin(theta5)...

+ s3pC(1,1)*cos(theta2)*sin(theta4)*sin(theta5)...

- s3pC(1,1)*cos(theta5)*sin(theta2)*sin(theta4));

F4_denominator=...

(s3pA(2,1)*cos(theta2)*cos(theta4)*sin(theta5)...

- s3pA(2,1)*cos(theta2)*cos(theta5)*sin(theta4)...

+ s3pB(2,1)*cos(theta2)*cos(theta5)*sin(theta4)...

- s3pB(2,1)*cos(theta4)*cos(theta5)*sin(theta2)...

- s3pC(2,1)*cos(theta2)*cos(theta4)*sin(theta5)...

+ s3pC(2,1)*cos(theta4)*cos(theta5)*sin(theta2)...

- s3pA(1,1)*cos(theta4)*sin(theta2)*sin(theta5)...

+ s3pA(1,1)*cos(theta5)*sin(theta2)*sin(theta4)...

- s3pB(1,1)*cos(theta2)*sin(theta4)*sin(theta5)...

+ s3pB(1,1)*cos(theta4)*sin(theta2)*sin(theta5)...

+ s3pC(1,1)*cos(theta2)*sin(theta4)*sin(theta5)...

- s3pC(1,1)*cos(theta5)*sin(theta2)*sin(theta4));

F5_denominator =...

(s3pA(2,1)*cos(theta2)*cos(theta4)*sin(theta5)...

- s3pA(2,1)*cos(theta2)*cos(theta5)*sin(theta4)...

+ s3pB(2,1)*cos(theta2)*cos(theta5)*sin(theta4)...

- s3pB(2,1)*cos(theta4)*cos(theta5)*sin(theta2)...

- s3pC(2,1)*cos(theta2)*cos(theta4)*sin(theta5)...

+ s3pC(2,1)*cos(theta4)*cos(theta5)*sin(theta2)...

46

- s3pA(1,1)*cos(theta4)*sin(theta2)*sin(theta5)...

+ s3pA(1,1)*cos(theta5)*sin(theta2)*sin(theta4)...

- s3pB(1,1)*cos(theta2)*sin(theta4)*sin(theta5)...

+ s3pB(1,1)*cos(theta4)*sin(theta2)*sin(theta5)...

+ s3pC(1,1)*cos(theta2)*sin(theta4)*sin(theta5)...

- s3pC(1,1)*cos(theta5)*sin(theta2)*sin(theta4));

F2x=F2*cos(theta2);

F2y=F2*sin(theta2);

F4x=F4*cos(theta4);

F4y=F4*sin(theta4);

F5x=F5*cos(theta5);

F5y=F5*sin(theta5);

% The following status variables are legacy

F2_status=0;

F4_status=0;

F5_status=0;

% Store information

info(adn,1:49)=[adn,...

r3(1,1),...

r3(2,1),...

phi3,...

L2,...

phi2,...

L4,...

phi4,...

L5,...

phi5,...

L6,...

phi6,...

phi2_deviation,...

phi4_deviation,...

phi5_deviation,...

phi6_deviation,...

F2x,...

F2y,...

F4x,...

F4y,...

F5x,...

F5y,...

F6x,...

F6y,...

F7x,...

F7y,...

F8x,...

F8y,...

F2,...

F4,...

F5,...

F6,...

F7,...

F8,...

F2_status,...

F4_status,...

F5_status,...

F2_denominator,...

F4_denominator,...

47

F5_denominator,...

L6,...

L7,...

L8,...

L2i,...

L4i,...

L5i,...

L6i,...

L7i,...

L8i];

% info columns

% 1 - adn

% 2 - r3x - global - mm

% 3 - r3y - global - mm

% 4 - phi3 - radians

% 5 - L2 - mm

% 6 - phi 2 - radians

% 7 - L4 - mm

% 8 - phi 4 - radians

% 9 - L5 - mm

% 10 - phi 5 - radians

% 11 - L6 - mm

% 12 - phi 6 - radians

% 13 - Phi2 Deviation

% 14 - Phi4 Deviation

% 15 - Phi5 Deviation

% 16 - Phi6 Deviation

% 17 - F2x

% 18 - F2y

% 19 - F4x

% 20 - F4y

% 21 - F5x

% 22 - F5y

% 23 - F6x

% 24 - F6y

% 25 - F7x

% 26 - F7y

% 27 - F8x

% 28 - F8y

% 29 - F2

% 30 - F4

% 31 - F5

% 32 - F6

% 33 - F7

% 34 - F8

% 35 - F2_status

% 36 - F4_status

% 37 - F5_status

% 38 - F2_denominator

% 39 - F4_denominator

% 40 - F5_denominator

% 41 - L6

% 42 - L7

% 43 - L8

% 44 - L2i

% 45 - L4i

% 46 - L5i

% 47 - L6i

% 48 - L7i

% 49 - L8i

48

% break out of the loop if any of the springs or links

% go to compression

if F2<0 || F4<0 || F5<0 || F6<0 || F7<0 || F8<0

%'one value is negative'

break;

end

adn=adn+1;

end % end adn while loop

%% step 4 - output the forces and lengths

% disp('r1E value is')

% disp(r1E)

% disp('r3E value is')

% disp(r3E)

% output the adn value

evaluated_forces_lengths=info(:,1);

% output the x and y coordinate

evaluated_forces_lengths(:,2:3)=current_path(1,2:3);

% output F2 through F8

evaluated_forces_lengths(:,4:9)=info(:,29:34);

% output L2i through L8i and L3 through L8

evaluated_forces_lengths(:,10:21)=...

[info(:,44:49),info(:,5),info(:,7),info(:,9),info(:,41:43)];

end % end of function

% evaluated_forces_lengths_gradients column info:

% 1 - adn

% 2 - x coordinate

% 3 - y coordinate

% 4 - F2

% 5 - F4

% 6 - F5

% 7 - F6

% 8 - F7

% 9 - F8

% 10 - L2i

% 11 - L4i

% 12 - L5i

% 13 - L6i

% 14 - L7i

% 15 - L8i

% 16 - L2

% 17 - L4

% 18 - L5

% 19 - L6

% 20 - L7

% 21 - L8

% end of MOSAIC_Solver_Loop_Rev_5.m

49

% File name - MOSAIC_permutations_rev_4.m

% Greg Brulo

% MOSAIC Kinematics - permutations

% Spring 2017

% Assume both attachment points on link 1 and link 3 must be on the same

% edge, i.e. both left edges for one link. This ensures the wires do not

% run accross link 3.

% rev_4 considerations:

% - link 2 - at top edge only

% - link 4 - at top edge only

% - link 5 - at left edge only

% - link 6 - at right edge only

% - link 7 - at right edge only

% - link 8 - at bottom left corner and turned off

% rev_3 considerations:

% - link 2 - at top edge only

% - link 4 - at top edge only

% - link 5 - at left edge only

% - link 6 - at bottom edge only

% - link 7 - at bottom edge only

% - link 8 - at bottom left corner and turned off

% rev_2 considerations:

% - link 2 - at top edge only

% - link 4 - at top edge only

% - link 5 - at left edge only

% - link 6 - at right edge only

% - link 7 - at bottom edge only

% - link 8 - at bottom left corner and turned off

% rev_1 considerations:

% - link 2 - at top edge only

% - link 4 - at top edge only

% - link 5 - at left edge only

% - link 6 - at bottom left corner and turned off

% - link 7 - at bottom edge or right edge only

% - link 8 - at bottom left corner and turned off

link_2_combinations=0;

% combinations for link 2 row info:

% 1 - link 2 point A on link 1

% 2 - link 2 point A on link 3

% left edge

% combinations of how link 2 can be connected on the left edge

link_2_link_1=1:1:7;

link_2_link_3=1:1:7;

link_2_combinations=combvec(link_2_link_1,link_2_link_3);

% 2x49

% top edge

% combinations of how link 2 can be connected on the top edge

link_2_link_1=8:1:14;

link_2_link_3=8:1:14;

% combinations of how link 2 can be connected on the left

% and top edges

link_2_combinations=[link_2_combinations,....

50

combvec(link_2_link_1,link_2_link_3)];

% 2x98

% right edge

% combinations of how link 2 can be connected on the right edge

link_2_link_1=15:1:21;

link_2_link_3=15:1:21;

% combinations of how link 2 can be connected on the left,

% top and right edges

link_2_combinations=[link_2_combinations,....

combvec(link_2_link_1,link_2_link_3)];

% 2x147

% bottom edge

% combinations of how link 2 can be connected on the bottom edge

link_2_link_1=22:1:28;

link_2_link_3=22:1:28;

% combinations of how link 2 can be connected on the left, top,

% right and bottom edges

link_2_combinations=[link_2_combinations,....

combvec(link_2_link_1,link_2_link_3)];

%2x196

link_2_combinations=link_2_combinations;

% generate other link combinations

% combinations for other links can be the same as link 2

link_4_combinations=link_2_combinations;

link_5_combinations=link_2_combinations;

link_6_combinations=link_2_combinations;

link_7_combinations=link_2_combinations;

link_8_combinations=link_2_combinations;

% generate total combinations

combinations_array=combvec(link_2_combinations(:,50:98),...

link_4_combinations(:,50:98), link_5_combinations(:,1:49),...

link_6_combinations(:,99:147),22,22,1,1)';

% link 2 can only be at the top edge

% link 4 can only be at the top edge

% link 5 can only be on the left edge

% link 6 can be only at the bottom edge only

% link 7 is set to 22,22 but will be looped through

% possibilities for right edge only

% link 8 is at bottom left corner and turned off

combinations_array_link_7=link_7_combinations(:,99:147)';

% combinations_array column info

% 1 - link 2 point A on link 1

% 2 - link 2 point A on link 3

% 3 - link 4 point C on link 1

% 4 - link 4 point C on link 3

% 5 - link 5 point B on link 1

% 6 - link 5 point B on link 3

% 7 - link 6 point D on link 1

% 8 - link 6 point D on link 3

% 9 - link 7 point I on link 1

% 10 - link 7 point I on link 3

% 11 - link 8 point J on link 1

% 12 - link 8 point J on link 3

51

% End of - MOSAIC_permutations_rev_4.m

52

% File name - MOSAIC_Link_1_possibilities_rev_2.m

% Greg Brulo

% MOSAIC Kinematics - possible attachment points for link 1

% Spring 2017

% measured wire feed through locations from CAD

% assume wire stays centered in wire feed through

% bottom left corner is [0,0]', will translate later for coordinate based

% on the center of the part

% rev 2 - made a matrix to store L1_1 - L1_28 and s1pE - s1pH

% this function does not have any inputs, however it outputs the outline of

% link 1 and it also generates a matrix of possible attachment points to

% link 1

% Use vector and matrix notation from Dr. Sommers Notes 04 01.

function [L1_possibilites,L1_outline] = MOSAIC_Link_1_possibilities_rev_2

L1_1=[0,15]'; % left edge, first from bottom corner

L1_2=[0,40]';

L1_3=[0,65]';

L1_4=[0,90]';

L1_5=[0,115]';

L1_6=[0,140]';

L1_7=[0,165]'; % left edge, furthest from bottom corner

L1_8=[15,180]'; % top edge, first from top left corner

L1_9=[40,180]';

L1_10=[65,180]';

L1_11=[90,180]';

L1_12=[115,180]';

L1_13=[140,180]';

L1_14=[165,180]'; % top edge, furthest from top left corner

L1_15=[180,165]'; % right edge, furthest from bottom right corner

L1_16=[180,140]';

L1_17=[180,115]';

L1_18=[180,90]';

L1_19=[180,65]';

L1_20=[180,40]';

L1_21=[180,15]'; % left edge, first from bottom right corner

L1_22=[165,0]'; % bottom edge, furthest from bottom left corner

L1_23=[140,0]';

L1_24=[115,0]';

L1_25=[90,0]';

L1_26=[65,0]';

L1_27=[40,0]';

L1_28=[15,0]'; % bottom edge, first from bottm left corner

s1pE = [180,180]'; % corners of link 1 for plotting

s1pF = [180,0]';

s1pG = [0,0]';

s1pH = [0,180]';

% Put the coordinate system in the middle of the link

53

original_to_new=[90,90]';

L1_1=L1_1-original_to_new;

L1_2=L1_2-original_to_new;

L1_3=L1_3-original_to_new;

L1_4=L1_4-original_to_new;

L1_5=L1_5-original_to_new;

L1_6=L1_6-original_to_new;

L1_7=L1_7-original_to_new;

L1_8=L1_8-original_to_new;

L1_9=L1_9-original_to_new;

L1_10=L1_10-original_to_new;

L1_11=L1_11-original_to_new;

L1_12=L1_12-original_to_new;

L1_13=L1_13-original_to_new;

L1_14=L1_14-original_to_new;

L1_15=L1_15-original_to_new;

L1_16=L1_16-original_to_new;

L1_17=L1_17-original_to_new;

L1_18=L1_18-original_to_new;

L1_19=L1_19-original_to_new;

L1_20=L1_20-original_to_new;

L1_21=L1_21-original_to_new;

L1_22=L1_22-original_to_new;

L1_23=L1_23-original_to_new;

L1_24=L1_24-original_to_new;

L1_25=L1_25-original_to_new;

L1_26=L1_26-original_to_new;

L1_27=L1_27-original_to_new;

L1_28=L1_28-original_to_new;

s1pE = s1pE-original_to_new;

s1pF = s1pF-original_to_new;

s1pG = s1pG-original_to_new;

s1pH = s1pH-original_to_new;

% rev 2 starts here

L1_possibilites=[L1_1';L1_2';L1_3';L1_4';L1_5';L1_6';L1_7';...

L1_8';L1_9';L1_10';...

L1_11';L1_12';L1_13';L1_14';L1_15';L1_16';L1_17';L1_18';...

L1_19';L1_20';...

L1_21';L1_22';L1_23';L1_24';L1_25';L1_26';L1_27';L1_28';...

];

L1_outline=[s1pE; s1pF; s1pG; s1pH];

end % stop function

% End of - MOSAIC_Link_1_possibilities_rev_2.m

54

% File name - MOSAIC_Link_3_possibilities_rev_4.m

% Greg Brulo

% MOSAIC Kinematics - possible attachment points for link 3

% Spring 2017

% Place wires every 25 mm

% bottom left corner is [0,0]', will translate later for coordinate based

% on the center of the part

% this function does not have any inputs, however it outputs the outline of

% link 3 and it also generates a matrix of possible attachment points to

% link 3

% Use vector and matrix notation from Dr. Sommers Notes 04 01.

function [L3_possibilites,L3_outline] = MOSAIC_Link_3_possibilities_rev_2

L3_1=[0,0]'; % left edge, first from bottom corner

L3_2=[0,23.3]';

L3_3=[0,46.7]';

L3_4=[0,70]';

L3_5=[0,93.3]';

L3_6=[0,116.7]';

L3_7=[0,140]'; % left edge, furthest from bottom corner

L3_8=[0,140]'; % top edge, first from top left corner

L3_9=[23.3,140]';

L3_10=[46.7,140]';

L3_11=[70,140]';

L3_12=[93.3,140]';

L3_13=[116.7,140]';

L3_14=[140,140]'; % top edge, furthest from top left corner

L3_15=[140,140]'; % right edge, furthest from bottom right corner

L3_16=[140,116.7]';

L3_17=[140,93.3]';

L3_18=[140,70]';

L3_19=[140,46.7]';

L3_20=[140,23.3]';

L3_21=[140,0]'; % left edge, first from bottom right corner

L3_22=[140,0]'; % bottom edge, furthest from bottom left corner

L3_23=[116.7,0]';

L3_24=[93.3,0]';

L3_25=[70,0]';

L3_26=[46.7,0]';

L3_27=[23.3,0]';

L3_28=[0,0]'; % bottom edge, first from bottm left corner

s3pE = [140,140]'; % corners of link 3 for plotting

s3pF = [140,0]';

s3pG = [0,0]';

s3pH = [0,140]';

% Put the coordinate system in the middle of the link

original_to_new=[70,70]';

L3_1=L3_1-original_to_new;

55

L3_2=L3_2-original_to_new;

L3_3=L3_3-original_to_new;

L3_4=L3_4-original_to_new;

L3_5=L3_5-original_to_new;

L3_6=L3_6-original_to_new;

L3_7=L3_7-original_to_new;

L3_8=L3_8-original_to_new;

L3_9=L3_9-original_to_new;

L3_10=L3_10-original_to_new;

L3_11=L3_11-original_to_new;

L3_12=L3_12-original_to_new;

L3_13=L3_13-original_to_new;

L3_14=L3_14-original_to_new;

L3_15=L3_15-original_to_new;

L3_16=L3_16-original_to_new;

L3_17=L3_17-original_to_new;

L3_18=L3_18-original_to_new;

L3_19=L3_19-original_to_new;

L3_20=L3_20-original_to_new;

L3_21=L3_21-original_to_new;

L3_22=L3_22-original_to_new;

L3_23=L3_23-original_to_new;

L3_24=L3_24-original_to_new;

L3_25=L3_25-original_to_new;

L3_26=L3_26-original_to_new;

L3_27=L3_27-original_to_new;

L3_28=L3_28-original_to_new;

s3pE = s3pE-original_to_new;

s3pF = s3pF-original_to_new;

s3pG = s3pG-original_to_new;

s3pH = s3pH-original_to_new;

% Rev 2 starts here

L3_possibilites=[L3_1';L3_2';L3_3';L3_4';...

L3_5';L3_6';L3_7';L3_8';...

L3_9';L3_10';...

L3_11';L3_12';L3_13';L3_14';L3_15';L3_16';L3_17';...

L3_18';L3_19';L3_20';...

L3_21';L3_22';L3_23';L3_24';L3_25';L3_26';L3_27';L3_28'];

L3_outline=[s3pE; s3pF; s3pG; s3pH];

end % end of function

% End of - MOSAIC_Link_3_possibilities_rev_4.m

56

% File name - MOSAIC_check_designs_SMA_rev_1.m

% - rev 1 -

% history - rev 1 - this code reads the different design forces and

% checks to see if SMA wire can be applied to the

% design

%

% Greg Brulo

% MOSAIC Kinematics

% Spring 2017

% Units are in mm, sec, N, radians

clear

clc

close all

d2r=pi/180; % convert from degrees to radians

t=tic;

%% step 1 - load the saved designs

% load the combination numbers of interest

loaded_designs=load('rev_15_1_spring_0_05kg_mass_hex_path_140x140_9N_PT.txt');

loaded_designs_max=size(loaded_designs,1);

disp('designs loaded')

disp('time to load designs')

toc(t)

% loaded designs column info

% 1 - combination number

% 2 - F2 min

% 3 - F4 min

% 4 - F5 min

% 5 - F6 min

% 6 - F7 min

% 7 - F8 min

% 8 - F2 max

% 9 - F4 max

% 10 - F5 max

% 11 - F6 max

% 12 - F7 max

% 13 - F8 max

% 14 - F2 mean

% 15 - F4 mean

% 16 - F5 mean

% 17 - F6 mean

% 18 - F7 mean

% 19 - F8 mean

%% step 3 - check to see if there is an SMA wire which complies

%for counter=1:loaded_designs_max

for counter=1:loaded_designs_max

57

% designs with SMA column info

% 1 - combination number

% 2 - F2 min

% 3 - F4 min

% 4 - F5 min

% 5 - F6 min

% 6 - F7 min

% 7 - F8 min

% 8 - F2 max

% 9 - F4 max

% 10 - F5 max

% 11 - F6 max

% 12 - F7 max

% 13 - F8 max

% 14 - F2 mean

% 15 - F4 mean

% 16 - F5 mean

% 17 - F6 mean

% 18 - F7 mean

% 19 - F8 mean

% 20 - link 2 wire size

% 21 - link 4 wire size

% 22 - link 5 wire size

% 23 - 1 if wires for 20, 21 and 22 can be selected, if not, then 0

F2_min=loaded_designs(counter,2);

F2_max=loaded_designs(counter,8);

F4_min=loaded_designs(counter,3);

F4_max=loaded_designs(counter,9);

F5_min=loaded_designs(counter,4);

F5_max=loaded_designs(counter,10);

link_2_size=MOSAIC_SMA_selector_rev_1(F2_min,F2_max);

link_4_size=MOSAIC_SMA_selector_rev_1(F4_min,F4_max);

link_5_size=MOSAIC_SMA_selector_rev_1(F5_min,F5_max);

if link_2_size~=0 && link_4_size~=0 && link_5_size~=0

wires_selected=1;

else

wires_selected=0;

end % end the if statement

designs_with_SMA(counter,:)=[loaded_designs(counter,:),...

link_2_size,link_4_size,link_5_size,wires_selected];

end % end of for loop

%% step 4 - save the data

save('rev_15_1_spring_0_05kg_mass_hex_path_140x140_9N_PT_with_wires','designs_w

ith_SMA','-ascii')

disp('total time')

toc(t)

% End of - MOSAIC_check_designs_SMA_rev_1.m

58

% File name - MOSAIC_SMA_selector_rev_1.m

% Greg Brulo

% MOSAIC

% June 2017

% history - rev 1 - select SMA wire based on Dynalloy,inc info on website

% http://www.dynalloy.com/tech_data_wire.php

function selected_diameter_wire=...

MOSAIC_SMA_selector_rev_1(Tension_min_N,Tension_max_N)

% this function selects the minimum diameter wire necessary

% to create a force greater than Tension_max at any length

% and have a cooling deformation

% force less than Tension_min

% Tension_max_N is the maximum required tension of the wire in N

% Tension_min_N is the minimum required tension of the wire in N

% Tension_max_lbf is converted to lbf

% Tension_min_lbf is converted to lbf

Tension_max_lbf=Tension_max_N/4.44822;

Tension_min_lbf=Tension_min_N/4.44822;

% SMA wire information

% wire_info column info:

% 1 - Diameter (inches)

% 2 - Heating pull force (lbs)

% 3 - Cooling deformation force (lbs)

% 4 - resistance (ohms/in)

wire_info=[0.001, 0.02, 0.008;...

0.0015, 0.04, 0.016;...

0.002, 0.08, 0.032;...

0.003, 0.18, 0.07;...

0.004, 0.31, 0.12;...

0.005, 0.49, 0.20;...

0.006, 0.71, 0.28;...

0.008, 1.26, 0.50;...

0.010, 1.96, 0.78;...

0.012, 2.83, 1.13;...

0.015, 4.42, 1.77;...

0.020, 7.85, 3.14];

[wire_info_height,wire_info_width]=size(wire_info);

% find the first row which the available heating pull force is greater

% than the required heating pull force

y=wire_info(:,2)>Tension_max_lbf;

first_row=find(y,1);

% check to see if the minimum tension in the design is greater than the

% cooling deformation the SMA wire requires

59

% check to see if there is sufficient tension to pull the wire

% back to original length

if Tension_min_lbf > wire_info(first_row,3)

% assign the selected diameter

selected_diameter_wire=wire_info(first_row,1);

else

% assign 0 for wire size

selected_diameter_wire=0;

end

end % end of function

60

% File name - MOSAIC_control_data_rev_3.m

% Greg Brulo

% MOSAIC Kinematics - Generates the data for controlling the middle sheet

% Spring 2017

clear all

clc

close all

%% step 1 - generate grid points to get data for

MOSAIC_draw_hex

grid_checked_max=size(grid_checked,1);

%% step 2 - select the combination number so the geometry of the links

% can be loaded

%enter the combination number to test

prompt='enter geometry combination number (8934042)';

get_number=inputdlg(prompt);

comb_number=str2num(get_number{1});

MOSAIC_permutations_rev_1

disp('done runing permutations')

d2r=pi/180; % convert from degrees to radians

MOSAIC_kinematic_forces_main_rev_8_picture_generator_rev_2

figure

%% step 3 - input other model info

% Spring info

% initial_length=60; % mm

k6=0.00; % N/mm 0.04

k7=0.04; % N/mm

k8=0.00; % N/mm

initial_tension_6=0; % 9 Newtons

initial_tension_7=9; % Newtons

initial_tension_8=0; % Newtons

% the following lengths are updated in the code automatically

L6i=15;

L7i=21.2132;

L8i=15;

% configure the tilt info

mass=0.05; % kg 0.05

phi_incline=45*d2r;

g=9.81; % m/s^2

% configure MOSAIC_other_info

% MOSAIC_other_info columns

% 1 - gravity constant m/s^2

% 2 - mass of middle sheet in kg

% 3 - initial tension on spring 6 N

% 4 - initial tension on spring 7 N

% 5 - initial tension on spring 8 N

61

% 6 - spring 6 spring constant N/mm

% 7 - spring 7 spring constant N/mm

% 8 - spring 8 spring constant N/mm

% 9 - phi_incline

MOSAIC_other_info(1,1:9)=[g,mass,initial_tension_6,...

initial_tension_7, initial_tension_8, k6, k7, k8, phi_incline];

%% Step 4 - assign coordinates, solve for the forces,...

% evaluate control info

for grid_counter=1:grid_checked_max

% Load path information

MOSAIC_get_path

current_path=[1,grid_checked(grid_counter,:)];

% assign geometry

[L1_possibilities,L1_outline] = MOSAIC_Link_1_possibilities_rev_2;

[L3_possibilities,L3_outline] = MOSAIC_Link_3_possibilities_rev_4;

current_combination=combinations_array(comb_number,:);

[MOSAIC_current_geometry_link_1, MOSAIC_current_geometry_link_3]...

=MOSAIC_assign_geometry_rev_2(L1_possibilities,...

L1_outline,L3_possibilities,L1_outline,current_combination);

% determine the forces and lengths

evaluated_forces_lengths=MOSAIC_Solver_Loop_rev_4(current_path,...

MOSAIC_current_geometry_link_1,MOSAIC_current_geometry_link_3,...

MOSAIC_other_info);

% determine the gradients

x_gradient_path=current_path;

delta_x=0.01;

x_gradient_path(1,2)=current_path(1,2)+delta_x;

evaluated_forces_lengths_for_x=...

MOSAIC_Solver_Loop_rev_4(x_gradient_path,...

MOSAIC_current_geometry_link_1,MOSAIC_current_geometry_link_3,...

MOSAIC_other_info);

x_gradients(1,1:6)=(evaluated_forces_lengths_for_x(1,16:21)-...

evaluated_forces_lengths(1,16:21))/delta_x;

% x_gradient column info

% 1 - G2x

% 2 - G4x

% 3 - G5x

% 4 - G6x

% 5 - G7x

% 6- G8x

y_gradient_path=current_path;

delta_y=0.01;

y_gradient_path(1,3)=current_path(1,3)+delta_y;

evaluated_forces_lengths_for_y=...

MOSAIC_Solver_Loop_rev_4(y_gradient_path,...

MOSAIC_current_geometry_link_1,MOSAIC_current_geometry_link_3,...

MOSAIC_other_info);

62

y_gradients(1,1:6)=(evaluated_forces_lengths_for_y(1,16:21)-...

evaluated_forces_lengths(1,16:21))/delta_y;

% y_gradient column info

% 1 - G2y

% 2 - G4y

% 3 - G5y

% 4 - G6y

% 5 - G7y

% 6- G8y

phi_gradient_path=current_path;

delta_phi=0.1*pi/180; % radians

evaluated_forces_lengths_for_phi=...

MOSAIC_Solver_Loop_rev_5(y_gradient_path,...

MOSAIC_current_geometry_link_1,MOSAIC_current_geometry_link_3,...

MOSAIC_other_info,delta_phi);

phi_gradients(1,1:6)=(evaluated_forces_lengths_for_phi(1,16:21)-...

evaluated_forces_lengths(1,16:21))/delta_phi;

% phi_gradient column info

% 1 - G2phi

% 2 - G4phi

% 3 - G5phi

% 4 - G6phi

% 5 - G7phi

% 6- G8phi

evaluated_forces_lengths_gradients(grid_counter,:)=...

[evaluated_forces_lengths(1,1:21),...

x_gradients,y_gradients,phi_gradients];

% evaluated_forces_lengths_gradients column info:

% 1 - adn

% 2 - x coordinate

% 3 - y coordinate

% 4 - F2

% 5 - F4

% 6 - F5

% 7 - F6

% 8 - F7

% 9 - F8

% 10 - L2i

% 11 - L4i

% 12 - L5i

% 13 - L6i

% 14 - L7i

% 15 - L8i

% 16 - L2

% 17 - L4

% 18 - L5

% 19 - L6

% 20 - L7

% 21 - L8

% 22 - G2x

% 23 - G4x

% 24 - G5x

% 25 - G6x

% 26 - G7x

63

% 27 - G8x

% 28 - G2y

% 29 - G4y

% 30 - G5y

% 31 - G6y

% 32 - G7y

% 33 - G8y

% 34 - G2phi

% 35 - G4phi

% 36 - G5phi

% 37 - G6phi

% 38 - G7phi

% 39 - G8phi

end % end of for loop

%% Step 5 - find the min and max sensitivities and forces

min_abs_G2x=min(abs( evaluated_forces_lengths_gradients(:,22)));

min_abs_G2y=min(abs( evaluated_forces_lengths_gradients(:,28)));

min_abs_G2phi=min(abs( evaluated_forces_lengths_gradients(:,34)));

min_abs_G4x=min(abs( evaluated_forces_lengths_gradients(:,23)));

min_abs_G4y=min(abs( evaluated_forces_lengths_gradients(:,29)));

min_abs_G4phi=min(abs( evaluated_forces_lengths_gradients(:,35)));

min_abs_G5x=min(abs( evaluated_forces_lengths_gradients(:,24)));

min_abs_G5y=min(abs( evaluated_forces_lengths_gradients(:,30)));

min_abs_G5phi=min(abs( evaluated_forces_lengths_gradients(:,36)));

min_abs_G7x=min(abs( evaluated_forces_lengths_gradients(:,26)));

min_abs_G7y=min(abs( evaluated_forces_lengths_gradients(:,32)));

min_abs_G7phi=min(abs( evaluated_forces_lengths_gradients(:,38)));

min_abs_gradient=min([min_abs_G2x,min_abs_G2y,...

min_abs_G4x,min_abs_G4y,...

min_abs_G5x,min_abs_G5y]);

max_abs_F2=max(abs(evaluated_forces_lengths_gradients(:,4)));

max_abs_F4=max(abs(evaluated_forces_lengths_gradients(:,5)));

max_abs_F5=max(abs(evaluated_forces_lengths_gradients(:,6)));

max_F2=max(evaluated_forces_lengths_gradients(:,4)); %(N)

max_F4=max(evaluated_forces_lengths_gradients(:,5)); %(N)

max_F5=max(evaluated_forces_lengths_gradients(:,6)); %(N)

min_F2=min(evaluated_forces_lengths_gradients(:,4)); %(N)

min_F4=min(evaluated_forces_lengths_gradients(:,5)); %(N)

min_F5=min(evaluated_forces_lengths_gradients(:,6)); %(N)

max_F2_lbf=max_F2/4.44822; %lbf

max_F4_lbf=max_F4/4.44822; %lbf

max_F5_lbf=max_F5/4.44822; %lbf

min_F2_lbf=min_F2/4.44822; %lbf

min_F4_lbf=min_F4/4.44822; %lbf

min_F5_lbf=min_F5/4.44822; %lbf

max_abs_force=max([max_F2,max_F4,max_F5, min_F2, min_F4, min_F5]);

64

max_abs_F7=max(abs(evaluated_forces_lengths_gradients(:,8)));

min_abs_F7=min(abs(evaluated_forces_lengths_gradients(:,8)));

max_length_L7=max(abs(evaluated_forces_lengths_gradients(:,20)));

min_length_L7=min(abs(evaluated_forces_lengths_gradients(:,20)));

%% Step 6 - Figure out stepper motor info (step count / rev & torque)

Wire_2_min_length=min(evaluated_forces_lengths_gradients(:,16));

Wire_2_max_length=max(evaluated_forces_lengths_gradients(:,16));

Wire_2_delta=Wire_2_max_length-Wire_2_min_length;

Wire_4_min_length=min(evaluated_forces_lengths_gradients(:,17));

Wire_4_max_length=max(evaluated_forces_lengths_gradients(:,17));

Wire_4_delta=Wire_4_max_length-Wire_4_min_length;

Wire_5_min_length=min(evaluated_forces_lengths_gradients(:,18));

Wire_5_max_length=max(evaluated_forces_lengths_gradients(:,18));

Wire_5_delta=Wire_5_max_length-Wire_5_min_length;

max_wire_delta=max([Wire_2_delta,Wire_4_delta,Wire_5_delta]);

pulley_diameter=7.5; % mm

pulley_circumference=pulley_diameter*pi; % mm

circumference=202.23/12; % mm - wrapped the 0.02" wire 12 times

% around the 1/4x20 bolt

pulley_circumference=circumference; %

rotation_needed=max_wire_delta/pulley_circumference;

desired_accurancy=0.012; % mm (translation of middle sheet)

rotation_resolution=min_abs_gradient*...

desired_accurancy/pulley_circumference; % number of turns

steps_needed=1/rotation_resolution;

max_torque_required=max_abs_force*pulley_diameter/2; % N*mm

max_torque_required_oz_in=max_torque_required*0.1416119; % oz*in

% figure out the lengths at (0,0) and compare to minimum lenghts

% check the coordinates

check_x=evaluated_forces_lengths_gradients(68,2);

check_y=evaluated_forces_lengths_gradients(68,3);

if(0==check_x && 0==check_y)

disp('centered lengths are correct')

else

disp('error calculating centered lengths')

end

% store the centered lengths of each control wire

Wire_2_centered_length=evaluated_forces_lengths_gradients(68,16);

Wire_4_centered_length=evaluated_forces_lengths_gradients(68,17);

Wire_5_centered_length=evaluated_forces_lengths_gradients(68,18);

% calculate the required strain to get to centered lengths

buffer=2; % how many extra mm of extension at longest

65

% lengths of the wires

Wire_2_centered_strain=...

Wire_2_max_length-Wire_2_centered_length+buffer;

Wire_4_centered_strain=...

Wire_4_max_length-Wire_4_centered_length+buffer;

Wire_5_centered_strain=...

Wire_5_max_length-Wire_5_centered_length+buffer;

% note this is not true strain, its delta length of the wire

circumference=202.23/12; % mm - wrapped the 0.02" wire 12 times

% around the 1/4x20 bolt

encoder_counts_per_rev=40000; % US digital E6

Wire_2_counts_to_center=Wire_2_centered_strain/...

circumference*encoder_counts_per_rev;

Wire_4_counts_to_center=Wire_4_centered_strain/...

circumference*encoder_counts_per_rev;

Wire_5_counts_to_center=Wire_5_centered_strain/...

circumference*encoder_counts_per_rev;

% store the count control info

library_data(:,1:9)=[evaluated_forces_lengths_gradients(:,1:3),...

evaluated_forces_lengths_gradients(:,16:18),...

evaluated_forces_lengths_gradients(:,16)-...

Wire_2_centered_length,...

evaluated_forces_lengths_gradients(:,17)-...

Wire_4_centered_length,...

evaluated_forces_lengths_gradients(:,18)-...

Wire_5_centered_length];

library_data(:,10:12)=[library_data(:,7)/circumference*...

encoder_counts_per_rev,...

library_data(:,8)/circumference*encoder_counts_per_rev,...

library_data(:,9)/circumference*encoder_counts_per_rev];

library_data(:,13:20)=[evaluated_forces_lengths_gradients(:,22)/...

circumference*encoder_counts_per_rev,...

evaluated_forces_lengths_gradients(:,23)/...

circumference*encoder_counts_per_rev,...

evaluated_forces_lengths_gradients(:,24)/...

circumference*encoder_counts_per_rev,...

evaluated_forces_lengths_gradients(:,26)/...

circumference*encoder_counts_per_rev,...

evaluated_forces_lengths_gradients(:,28)/...

circumference*encoder_counts_per_rev,...

evaluated_forces_lengths_gradients(:,29)/...

circumference*encoder_counts_per_rev,...

evaluated_forces_lengths_gradients(:,30)/...

circumference*encoder_counts_per_rev,...

evaluated_forces_lengths_gradients(:,32)/...

circumference*encoder_counts_per_rev];

library_data(:,21:24)=[evaluated_forces_lengths_gradients(:,34)...

/circumference*encoder_counts_per_rev,...

evaluated_forces_lengths_gradients(:,35)...

/circumference*encoder_counts_per_rev,...

evaluated_forces_lengths_gradients(:,36)...

/circumference*encoder_counts_per_rev,...

66

evaluated_forces_lengths_gradients(:,38)...

/circumference*encoder_counts_per_rev];

library_data_height=size(library_data,1);

library_data(1:library_data_height,1)=[1:1:library_data_height]';

my_name=strcat('library_info_for_comb_number_',...

num2str(comb_number),'.txt');

save(my_name,'library_data','-ascii')

% save(library_data_run_

% library data column info:

% 1 Seq Number

% 2 X coordinate (mm)

% 3 Y coordinate (mm)

% 4 Link 2 length (mm)

% 5 Link 4 length (mm)

% 6 Link 5 length (mm)

% 7 Link 2 delta (mm) // delta is from the centered location

% 8 Link 4 delta (mm)

% 9 Link 5 delta (mm)

% 10 Link 2 counts (counts) // counts is from centered location

% 11 Link 4 counts (counts)

% 12 Link 5 counts (counts)

% 13 G2x (delta link 2 (counts) / delta link 3 x (mm))

% 14 G4x (delta link 4 (counts) / delta link 3 x (mm))

% 15 G5x (delta link 5 (counts) / delta link 3 x (mm))

% 16 G7x (delta link 7 (counts) / delta link 3 x (mm))

% 17 G2y (delta link 2 (counts) / delta link 3 x (mm))

% 18 G4y (delta link 4 (counts) / delta link 3 x (mm))

% 19 G5y (delta link 5 (counts) / delta link 3 x (mm))

% 20 G7y (delta link 7 (counts) / delta link 3 x (mm))

% 21 G2phi (delta link 2 (counts) / delta link 3 phi (rad))

% 22 G4phi (delta link 4 (counts) / delta link 3 phi (rad))

% 23 G5phi (delta link 5 (counts) / delta link 3 phi (rad))

% 24 G7phi (delta link 7 (counts) / delta link 3 phi (rad))

%% Step 6 - plot the sensitivities

% Plot G2 Sensitivity

xx=evaluated_forces_lengths_gradients(:,2);

yy=evaluated_forces_lengths_gradients(:,3);

zz=evaluated_forces_lengths_gradients(:,22);

x=reshape(xx,45,3)';

y=reshape(yy,45,3)';

z=reshape(zz,45,3)';

figure

subplot(1,2,1)

colormap hsv

surf(x,y,z,'FaceColor','interp',...

'EdgeColor','none',...

'FaceLighting','gouraud')

xlabel('x location (mm)')

67

ylabel('y location (mm)')

zlabel('Movement Sensitivity, delta wire length/delta x (mm/mm)')

title('G2x Sensitivity')

xx=evaluated_forces_lengths_gradients(:,2);

yy=evaluated_forces_lengths_gradients(:,3);

zz=evaluated_forces_lengths_gradients(:,28);

x=reshape(xx,45,3)';

y=reshape(yy,45,3)';

z=reshape(zz,45,3)';

subplot(1,2,2)

surf(x,y,z,'FaceColor','interp',...

'EdgeColor','none',...

'FaceLighting','gouraud')

xlabel('x location (mm)')

ylabel('y location (mm)')

zlabel('Movement Sensitivity, delta wire length/delta y (mm/mm)')

title('G2y Sensitivity')

% Plot G4 Sensitivity

xx=evaluated_forces_lengths_gradients(:,2);

yy=evaluated_forces_lengths_gradients(:,3);

zz=evaluated_forces_lengths_gradients(:,23);

x=reshape(xx,45,3)';

y=reshape(yy,45,3)';

z=reshape(zz,45,3)';

figure

subplot(1,2,1)

colormap hsv

surf(x,y,z,'FaceColor','interp',...

'EdgeColor','none',...

'FaceLighting','gouraud')

xlabel('x location (mm)')

ylabel('y location (mm)')

zlabel('Movement Sensitivity, delta wire length/delta x (mm/mm)')

title('G4x Sensitivity')

xx=evaluated_forces_lengths_gradients(:,2);

yy=evaluated_forces_lengths_gradients(:,3);

zz=evaluated_forces_lengths_gradients(:,29);

x=reshape(xx,45,3)';

y=reshape(yy,45,3)';

z=reshape(zz,45,3)';

subplot(1,2,2)

surf(x,y,z,'FaceColor','interp',...

'EdgeColor','none',...

'FaceLighting','gouraud')

xlabel('x location (mm)')

ylabel('y location (mm)')

zlabel('Movement Sensitivity, delta wire length/delta y (mm/mm)')

title('G4y Sensitivity')

% Plot G5 Sensitivity

xx=evaluated_forces_lengths_gradients(:,2);

yy=evaluated_forces_lengths_gradients(:,3);

zz=evaluated_forces_lengths_gradients(:,24);

x=reshape(xx,45,3)';

y=reshape(yy,45,3)';

68

z=reshape(zz,45,3)';

figure

subplot(1,2,1)

colormap hsv

surf(x,y,z,'FaceColor','interp',...

'EdgeColor','none',...

'FaceLighting','gouraud')

xlabel('x location (mm)')

ylabel('y location (mm)')

zlabel('Movement Sensitivity, delta wire length/delta x (mm/mm)')

title('G5x Sensitivity')

xx=evaluated_forces_lengths_gradients(:,2);

yy=evaluated_forces_lengths_gradients(:,3);

zz=evaluated_forces_lengths_gradients(:,30);

x=reshape(xx,45,3)';

y=reshape(yy,45,3)';

z=reshape(zz,45,3)';

subplot(1,2,2)

surf(x,y,z,'FaceColor','interp',...

'EdgeColor','none',...

'FaceLighting','gouraud')

xlabel('x location (mm)')

ylabel('y location (mm)')

zlabel('Movement Sensitivity, delta wire length/delta y (mm/mm)')

title('G5y Sensitivity')

%% Step 7 - plot the forces

% Plot F2 Force

xx=evaluated_forces_lengths_gradients(:,2);

yy=evaluated_forces_lengths_gradients(:,3);

zz=evaluated_forces_lengths_gradients(:,4)/4.448;

x=reshape(xx,45,3)';

y=reshape(yy,45,3)';

z=reshape(zz,45,3)';

figure

subplot(2,2,1)

colormap hsv

surf(x,y,z,'FaceColor','interp',...

'EdgeColor','none',...

'FaceLighting','gouraud')

xlabel('x location (mm)')

ylabel('y location (mm)')

zlabel('Wire Tension (lbf)')

title('Wire 2 Force')

% Plot F4 Force

xx=evaluated_forces_lengths_gradients(:,2);

yy=evaluated_forces_lengths_gradients(:,3);

zz=evaluated_forces_lengths_gradients(:,5)/4.448;

x=reshape(xx,45,3)';

y=reshape(yy,45,3)';

z=reshape(zz,45,3)';

subplot(2,2,2)

colormap hsv

69

surf(x,y,z,'FaceColor','interp',...

'EdgeColor','none',...

'FaceLighting','gouraud')

xlabel('x location (mm)')

ylabel('y location (mm)')

zlabel('Wire Tension (lbf)')

title('Wire 4 Force')

% Plot F5 Force

xx=evaluated_forces_lengths_gradients(:,2);

yy=evaluated_forces_lengths_gradients(:,3);

zz=evaluated_forces_lengths_gradients(:,6)/4.448;

x=reshape(xx,45,3)';

y=reshape(yy,45,3)';

z=reshape(zz,45,3)';

subplot(2,2,3)

colormap hsv

surf(x,y,z,'FaceColor','interp',...

'EdgeColor','none',...

'FaceLighting','gouraud')

xlabel('x location (mm)')

ylabel('y location (mm)')

zlabel('Wire Tension (lbf)')

title('Wire 5 Force')

% Plot F7 Force

xx=evaluated_forces_lengths_gradients(:,2);

yy=evaluated_forces_lengths_gradients(:,3);

zz=evaluated_forces_lengths_gradients(:,8)/4.448;

x=reshape(xx,45,3)';

y=reshape(yy,45,3)';

z=reshape(zz,45,3)';

subplot(2,2,4)

colormap hsv

surf(x,y,z,'FaceColor','interp',...

'EdgeColor','none',...

'FaceLighting','gouraud')

xlabel('x location (mm)')

ylabel('y location (mm)')

zlabel('Wire Tension (lbf)')

title('Wire 7 Force')

% End of - MOSAIC_control_data_rev_3.m