mfp3d manual 04 08

321

Upload: emilio-aniant

Post on 08-Nov-2014

130 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: MFP3d Manual 04 08
Page 2: MFP3d Manual 04 08
Page 3: MFP3d Manual 04 08
Page 4: MFP3d Manual 04 08

Chapter 1

Chapter 2

Chapter 3

Chapter 4

Page 5: MFP3d Manual 04 08

Chapter 5

Chapter 6

Page 6: MFP3d Manual 04 08

Chapter 7

Chapter 8

Page 7: MFP3d Manual 04 08

Chapter 9

Chapter 10

Chapter 11

Chapter 12

Page 8: MFP3d Manual 04 08
Page 9: MFP3d Manual 04 08
Page 10: MFP3d Manual 04 08
Page 11: MFP3d Manual 04 08
Page 12: MFP3d Manual 04 08
Page 13: MFP3d Manual 04 08
Page 14: MFP3d Manual 04 08

0

180

Page 15: MFP3d Manual 04 08
Page 16: MFP3d Manual 04 08
Page 17: MFP3d Manual 04 08
Page 18: MFP3d Manual 04 08

Chapter 1

Page 19: MFP3d Manual 04 08
Page 20: MFP3d Manual 04 08
Page 21: MFP3d Manual 04 08
Page 22: MFP3d Manual 04 08
Page 27: MFP3d Manual 04 08
Page 28: MFP3d Manual 04 08
Page 29: MFP3d Manual 04 08

Chapter 2

Page 30: MFP3d Manual 04 08
Page 31: MFP3d Manual 04 08
Page 32: MFP3d Manual 04 08
Page 33: MFP3d Manual 04 08
Page 34: MFP3d Manual 04 08

Chapter 3

Page 35: MFP3d Manual 04 08
Page 36: MFP3d Manual 04 08
Page 37: MFP3d Manual 04 08
Page 38: MFP3d Manual 04 08
Page 39: MFP3d Manual 04 08

Chapter 4

Page 40: MFP3d Manual 04 08
Page 41: MFP3d Manual 04 08
Page 42: MFP3d Manual 04 08
Page 43: MFP3d Manual 04 08
Page 44: MFP3d Manual 04 08
Page 45: MFP3d Manual 04 08
Page 46: MFP3d Manual 04 08
Page 47: MFP3d Manual 04 08
Page 48: MFP3d Manual 04 08
Page 49: MFP3d Manual 04 08
Page 50: MFP3d Manual 04 08
Page 51: MFP3d Manual 04 08
Page 52: MFP3d Manual 04 08
Page 53: MFP3d Manual 04 08
Page 54: MFP3d Manual 04 08
Page 55: MFP3d Manual 04 08
Page 56: MFP3d Manual 04 08
Page 57: MFP3d Manual 04 08
Page 58: MFP3d Manual 04 08
Page 59: MFP3d Manual 04 08
Page 60: MFP3d Manual 04 08

Chapter 5

Page 61: MFP3d Manual 04 08
Page 63: MFP3d Manual 04 08
Page 64: MFP3d Manual 04 08
Page 65: MFP3d Manual 04 08
Page 66: MFP3d Manual 04 08
Page 67: MFP3d Manual 04 08
Page 68: MFP3d Manual 04 08
Page 69: MFP3d Manual 04 08
Page 70: MFP3d Manual 04 08
Page 71: MFP3d Manual 04 08
Page 72: MFP3d Manual 04 08
Page 73: MFP3d Manual 04 08
Page 74: MFP3d Manual 04 08
Page 75: MFP3d Manual 04 08
Page 76: MFP3d Manual 04 08
Page 77: MFP3d Manual 04 08
Page 78: MFP3d Manual 04 08
Page 80: MFP3d Manual 04 08
Page 81: MFP3d Manual 04 08
Page 82: MFP3d Manual 04 08
Page 83: MFP3d Manual 04 08
Page 84: MFP3d Manual 04 08
Page 85: MFP3d Manual 04 08
Page 86: MFP3d Manual 04 08
Page 87: MFP3d Manual 04 08
Page 88: MFP3d Manual 04 08
Page 89: MFP3d Manual 04 08
Page 90: MFP3d Manual 04 08
Page 91: MFP3d Manual 04 08
Page 93: MFP3d Manual 04 08
Page 94: MFP3d Manual 04 08
Page 95: MFP3d Manual 04 08
Page 96: MFP3d Manual 04 08
Page 97: MFP3d Manual 04 08
Page 98: MFP3d Manual 04 08
Page 99: MFP3d Manual 04 08
Page 100: MFP3d Manual 04 08
Page 101: MFP3d Manual 04 08
Page 102: MFP3d Manual 04 08
Page 103: MFP3d Manual 04 08
Page 104: MFP3d Manual 04 08
Page 105: MFP3d Manual 04 08
Page 106: MFP3d Manual 04 08
Page 107: MFP3d Manual 04 08
Page 108: MFP3d Manual 04 08

td_wv(“ParameterName”)

td_rv(“ParameterName”)

ParameterName

X%Output, Y%Output, and Z%Output

X%Input, Y%Input, and Z%Input

A%Output, B%Output, C%Output

A%Input, B%Input

Amp%DDS, Freq%DDS, (and others)

Page 109: MFP3d Manual 04 08

Fast%Input

R%Input, Theta%Input, I%Input, and Q%Input

Page 110: MFP3d Manual 04 08
Page 111: MFP3d Manual 04 08
Page 112: MFP3d Manual 04 08
Page 113: MFP3d Manual 04 08
Page 114: MFP3d Manual 04 08
Page 115: MFP3d Manual 04 08
Page 116: MFP3d Manual 04 08
Page 117: MFP3d Manual 04 08
Page 118: MFP3d Manual 04 08
Page 119: MFP3d Manual 04 08
Page 120: MFP3d Manual 04 08
Page 121: MFP3d Manual 04 08
Page 122: MFP3d Manual 04 08
Page 123: MFP3d Manual 04 08

*

Page 124: MFP3d Manual 04 08
Page 125: MFP3d Manual 04 08
Page 126: MFP3d Manual 04 08
Page 127: MFP3d Manual 04 08
Page 128: MFP3d Manual 04 08
Page 129: MFP3d Manual 04 08
Page 130: MFP3d Manual 04 08
Page 131: MFP3d Manual 04 08
Page 132: MFP3d Manual 04 08
Page 134: MFP3d Manual 04 08
Page 135: MFP3d Manual 04 08
Page 136: MFP3d Manual 04 08
Page 137: MFP3d Manual 04 08
Page 138: MFP3d Manual 04 08
Page 139: MFP3d Manual 04 08

Chapter 6

Page 140: MFP3d Manual 04 08
Page 141: MFP3d Manual 04 08
Page 142: MFP3d Manual 04 08

iirms zA 2

iiconstrms zzA 2)(

Page 143: MFP3d Manual 04 08

2/AArms

Page 144: MFP3d Manual 04 08
Page 145: MFP3d Manual 04 08
Page 147: MFP3d Manual 04 08
Page 148: MFP3d Manual 04 08
Page 149: MFP3d Manual 04 08
Page 150: MFP3d Manual 04 08
Page 151: MFP3d Manual 04 08
Page 152: MFP3d Manual 04 08
Page 154: MFP3d Manual 04 08
Page 155: MFP3d Manual 04 08
Page 156: MFP3d Manual 04 08
Page 157: MFP3d Manual 04 08
Page 158: MFP3d Manual 04 08
Page 159: MFP3d Manual 04 08
Page 160: MFP3d Manual 04 08
Page 161: MFP3d Manual 04 08
Page 162: MFP3d Manual 04 08
Page 163: MFP3d Manual 04 08
Page 164: MFP3d Manual 04 08
Page 165: MFP3d Manual 04 08

0180

)2sin( ftAV dd

dA f

Page 166: MFP3d Manual 04 08

)2sin( ftAV respresp

θ

rad)/180(deg

θ

Page 167: MFP3d Manual 04 08

radiansT

t2

Tt360

θ

-1.0

-0.5

0.0

0.5

1.0

50µsec403020100

Time

t=1.13 secT=13.51 sec

Vd

Vresp

Page 168: MFP3d Manual 04 08

θ

),(),(),(

2

2

4

4

txFt

txw

x

txwEI

d

Page 169: MFP3d Manual 04 08
Page 170: MFP3d Manual 04 08

)(zFzbkzFzm tipdrive

ω

Page 171: MFP3d Manual 04 08

ω

)](cos[)( tAz

ω φ ω

2

220222

0

20)(

Q

AA drive

)/()(tan 00Q

ω

ω ω

ω φ ω

Page 172: MFP3d Manual 04 08
Page 173: MFP3d Manual 04 08
Page 174: MFP3d Manual 04 08
Page 175: MFP3d Manual 04 08

)sin( 0

2/0

t

Qt

tt teAz

Page 176: MFP3d Manual 04 08

τ ω

ττ

Page 177: MFP3d Manual 04 08
Page 178: MFP3d Manual 04 08
Page 180: MFP3d Manual 04 08
Page 181: MFP3d Manual 04 08
Page 182: MFP3d Manual 04 08

Chapter 7

Page 183: MFP3d Manual 04 08
Page 184: MFP3d Manual 04 08
Page 185: MFP3d Manual 04 08
Page 186: MFP3d Manual 04 08
Page 187: MFP3d Manual 04 08
Page 188: MFP3d Manual 04 08
Page 189: MFP3d Manual 04 08
Page 190: MFP3d Manual 04 08
Page 191: MFP3d Manual 04 08
Page 192: MFP3d Manual 04 08
Page 193: MFP3d Manual 04 08
Page 194: MFP3d Manual 04 08
Page 195: MFP3d Manual 04 08
Page 196: MFP3d Manual 04 08
Page 197: MFP3d Manual 04 08
Page 198: MFP3d Manual 04 08
Page 199: MFP3d Manual 04 08
Page 200: MFP3d Manual 04 08
Page 201: MFP3d Manual 04 08
Page 202: MFP3d Manual 04 08
Page 203: MFP3d Manual 04 08
Page 204: MFP3d Manual 04 08
Page 206: MFP3d Manual 04 08

Chapter 8

Page 207: MFP3d Manual 04 08
Page 208: MFP3d Manual 04 08
Page 209: MFP3d Manual 04 08
Page 210: MFP3d Manual 04 08
Page 211: MFP3d Manual 04 08
Page 212: MFP3d Manual 04 08
Page 213: MFP3d Manual 04 08
Page 214: MFP3d Manual 04 08
Page 215: MFP3d Manual 04 08
Page 216: MFP3d Manual 04 08
Page 217: MFP3d Manual 04 08
Page 218: MFP3d Manual 04 08
Page 219: MFP3d Manual 04 08
Page 220: MFP3d Manual 04 08
Page 221: MFP3d Manual 04 08
Page 222: MFP3d Manual 04 08
Page 223: MFP3d Manual 04 08
Page 224: MFP3d Manual 04 08
Page 225: MFP3d Manual 04 08
Page 226: MFP3d Manual 04 08
Page 227: MFP3d Manual 04 08
Page 228: MFP3d Manual 04 08
Page 229: MFP3d Manual 04 08
Page 230: MFP3d Manual 04 08
Page 231: MFP3d Manual 04 08
Page 232: MFP3d Manual 04 08
Page 233: MFP3d Manual 04 08
Page 234: MFP3d Manual 04 08
Page 235: MFP3d Manual 04 08
Page 236: MFP3d Manual 04 08
Page 237: MFP3d Manual 04 08
Page 238: MFP3d Manual 04 08
Page 239: MFP3d Manual 04 08
Page 240: MFP3d Manual 04 08
Page 241: MFP3d Manual 04 08
Page 242: MFP3d Manual 04 08
Page 243: MFP3d Manual 04 08
Page 244: MFP3d Manual 04 08
Page 245: MFP3d Manual 04 08

Chapter 9

Page 246: MFP3d Manual 04 08
Page 247: MFP3d Manual 04 08
Page 248: MFP3d Manual 04 08

F k x

Page 249: MFP3d Manual 04 08
Page 250: MFP3d Manual 04 08
Page 251: MFP3d Manual 04 08
Page 252: MFP3d Manual 04 08
Page 253: MFP3d Manual 04 08
Page 254: MFP3d Manual 04 08
Page 255: MFP3d Manual 04 08
Page 256: MFP3d Manual 04 08
Page 257: MFP3d Manual 04 08
Page 258: MFP3d Manual 04 08
Page 259: MFP3d Manual 04 08
Page 260: MFP3d Manual 04 08

Chapter 10

Page 261: MFP3d Manual 04 08
Page 262: MFP3d Manual 04 08
Page 264: MFP3d Manual 04 08
Page 266: MFP3d Manual 04 08
Page 267: MFP3d Manual 04 08
Page 268: MFP3d Manual 04 08
Page 269: MFP3d Manual 04 08
Page 270: MFP3d Manual 04 08
Page 271: MFP3d Manual 04 08
Page 272: MFP3d Manual 04 08
Page 273: MFP3d Manual 04 08
Page 274: MFP3d Manual 04 08
Page 275: MFP3d Manual 04 08
Page 276: MFP3d Manual 04 08
Page 277: MFP3d Manual 04 08
Page 278: MFP3d Manual 04 08
Page 279: MFP3d Manual 04 08

Duplicate/O OldBaseNameSpotX, NewBaseNameSpotX

Duplicate/O OldBaseNameSpotY, NewBaseNameSpotY

Page 281: MFP3d Manual 04 08

Chapter 11

Page 282: MFP3d Manual 04 08
Page 284: MFP3d Manual 04 08
Page 285: MFP3d Manual 04 08
Page 286: MFP3d Manual 04 08
Page 287: MFP3d Manual 04 08
Page 288: MFP3d Manual 04 08

SetDataFolder(GetDF("Litho"))

Page 289: MFP3d Manual 04 08

ModifyGraph textMarker(LithoStepY)={LithoTimeWave,"default",0,0,5,0.00,0.00}

ModifyGraph textMarker(LithoStepY)={LithoVolts,"default",0,0,5,0.00,0.00}

ModifyGraph textMarker(LithoStepY)=0

Page 290: MFP3d Manual 04 08
Page 291: MFP3d Manual 04 08
Page 292: MFP3d Manual 04 08

Chapter 12

Page 293: MFP3d Manual 04 08

Function SayHiOrBye(HiOrBye) String HiOrBye if (StringMatch(HiOrBye,"Hi")) Print "Hi to you as well" elseif (StringMatch(HiOrBye,"Bye")) Print "Bye, then"else //Unknown input Print "greeting unknown" endif End //SayHiOrBye

Page 294: MFP3d Manual 04 08

SayHiOrBye("hi")

SayHiOrBye("bye")

SayHiOrBye("blah")

Page 295: MFP3d Manual 04 08

StrSwitch-Case-EndSwitch Switch-case-EndSwitch.

Switch Statements

Function GetThermalFreq() Variable Freq RunARMacro("DoAThermal") //imaginary Macro that does a thermal tune from the //thermal panel on the master control panel Freq = GV("ThermalQ") //This function looks in the global Variable table for a Variable //called thermalQ. More on this in the text of the help file Print "The Thermal Q is:", Freq End //GetThermalFreq

Function GetThermalFreq2(CaseToggle) String CaseToggle CaseToggle = "DoAThermal" Variable Freq

Page 296: MFP3d Manual 04 08

StrSwitch(CaseToggle) // String switch case "FirstDoAThermal": // execute if case matches expression RunARMacro("DoAThermal") CaseToggle = "NextGetTheThermalQ" break // exit from switch

case "NextGetTheThermalQ": // execute if case matches expression Freq = GV("ThermalQ") break EndSwitch End // GetThermalFreq2

Page 297: MFP3d Manual 04 08
Page 298: MFP3d Manual 04 08

Function CreateFolderExample(exptID, PassToAnotherFunction) String exptID Variable PassToAnotherFunction String SavedDataFolder = GetDataFolder(1) NewDatafolder/S /O $"root:"+exptID RunAnotherFunction(PassToAnotherFunction) SetDataFolder SavedDataFolder End //CreateFolderExample

NewDataFolderGetDataFolder

SetDataFolder

Function CreateFolderExample2(PassToAnotherFunction) Variable PassToAnotherFunction

Page 299: MFP3d Manual 04 08

String SavedDataFolder = GetDataFolder(1) //Store the current data folder SetDataFolder root: RunAnotherFunction(PassToAnotherFunction) SetDataFolder SavedDataFolder End //CreateFolderExampleFolder2

Page 300: MFP3d Manual 04 08

Function WaveFeederFunction(exptID,MaxIndex) String exptID Variable MaxIndex Variable Index = 0 String SavedDataFolder = GetDataFolder(1) NewDataFolder/S/O $"root:"+exptID Make/O/N=(MaxIndex) YCoordWave //Here we make a wave to //feed from within this Function YCoordWave[Index,MaxIndex] = P*5 Make/O/N=(MaxIndex) XCoordWave //This wave will be defined in the inner Function, //but is created here RunAFunctionThatNeedsTheseWaves() //here is where the shell Function //calls the inner Function SetDataFolder SavedDataFolder End //WaveFeederFunction Function RunAFunctionThatNeedsTheseWaves() //Making the inner Function, where //waves will be manipulated Wave YCoordWave //the wave reference tells this Function //to look for a wave //that already exists in the current data folder. Wave XCoordWave XCoordwave = P Edit/K=1 XCoordWave, YCoordWave //brings up a chart with the waves in it End //RunSomeFunctionThatNeedsTheseWaves

Page 301: MFP3d Manual 04 08

Variable xyz

String myString

Variable xyz =12.5 String myString = "mine"

Variable/G Gxyz

String/G myString = "mine"

Page 302: MFP3d Manual 04 08

NVAR Gxyz SVAR myString

Function EggSample (myString,xyz) String myString Variable xyz End //EggSample

Page 303: MFP3d Manual 04 08

Function CallbackExample(Message) String Message String SavedDataFolder = GetDataFolder(1) SetDataFolder root: String/G GMessage = Message // template: ARU_Callback(number,milli seconds,Callback) ARU_Callback(0,5000,"Print root:Gmessage") SetDataFolder SavedDataFolder

End //CallbackExample

Function CallbackExample2(Message) String Message String SavedDataFolder = GetDataFolder(1) SetDataFolder root: String/G Gmessage2 = Message ARU_Callback(0,5000,"CallbackPrintFunction(root:Gmessage2)"

Page 304: MFP3d Manual 04 08

SetDataFolder SavedDataFolder End //CallbackExample2 Function CallbackPrintFunction(Message) String Message Print Message End //CallbackPrintFunction

//Callback = "CasesForNoNontactCalc(Width,Length,EstimatedFreq)"

//Callback = "CasesForNonContactCalc("+num2str(Width)+","+num2str(Length)+","+num2str(EstimatedFreq)+",\"NextDoSader\")"

//Callback = "CasesForNoNontactCalc(" //Callback += num2str(Width) //Callback += "," //Callback += num2str(Length)

Page 305: MFP3d Manual 04 08

//Callback += ","

//Callback += num2str(EstimatedFreq) //Callback += "," //Callback += "\"NextDoSader\"" //Callback += ")"

'\'

'"\"NextDoSader\"'

Page 306: MFP3d Manual 04 08

Extra Help

for td_xSetOutWave.

td_xSetOutWave(whichBank, eventString, channelString, wave, interpolation)

Page 307: MFP3d Manual 04 08

#pragma rtGlobals=1 // Use modern global access method. Function DoIV(range) variable range td_StopInWaveBank(-1) td_WriteString("0%event", "clear") make/o/n = 8192 VoltageWave CurrentWave CurrentWave = 0 VoltageWave = -range + p/8192 * (2*range) td_xSetInWave(2, "0%event@controller,never", "A%Input", CurrentWave,"IVCallback()",20) td_xSetOutWave(0,"0%event@controller,never", "A%Output", VoltageWave, -20) td_WriteValue("A%Output", -range) Sleep/T 20 td_WriteString("0%event", "once") End //DoIV Function IVCallback() WAVE CurrentWave SetScale d 0,0,"A", CurrentWave CurrentWave/= -500e6 End // IVCallback

xSetOutWave xSetInWave

0,0 0%event,0%event

0%event@controller,0%event@controller

Page 308: MFP3d Manual 04 08
Page 309: MFP3d Manual 04 08

Function Pulse(Wait, PulseWidth, PulseHeight) //wait will pause for a short period of time before initiating the pulse variable PulseWidth, PulseHeight, Wait variable ScanTIme = 2*Wait+PulseWidth // set the total time the wave will take to execute with 2 times the wait for //wiggle room variable Decimation variable Point1, Point2, ActualWaitTime td_StopOutWaveBank(0) //clears any waves already in the bank we will use td_StopInWaveBank(0) //clears inwave bank td_writestring("0%event@controller", "clear") //clears the event string make/O/N=(2^8) ThePulse PulseResponse Decimation = round(1e5*ScanTIme/dimsize(ThePulse,0)) //This is the programming version of the equation in the text ActualWaitTime = dimsize(ThePulse,0)*Decimation/1e5 // this converts the desired wait time to one that will fit the math Wait = (ActualWaitTime-PulseWidth)/2 td_xsetinwave(0, "0", "b%Input",

Page 310: MFP3d Manual 04 08

PulseResponse,"ImaginaryCallback()",Decimation) //set up the waves. but the td_xsetoutwave(0,"0", "b%Output", ThePulse, Decimation) //y values are zero, this is only to get //the x scaling correct Point1=x2pnt(ThePulse,wait) //This converts the xscaled values returned by the controller Point2=x2pnt(ThePulse, wait+PulseWidth) //into points to make the math better ThePulse[0,Point1]=0 //pulse is zero until it reaches point one ThePulse[Point1,Point2] = PulseHeight //now pulse is equal to pulse height ThePulse[Point2,] = 0 //back to zero. Notice if the second point is left //blank Igor defaults to the end. td_xsetoutwave(0,"0", "b%Output", ThePulse, Decimation) //now that we have the y values we need to resend the wave. td_WriteString("0%event@controller","once") //set the event to set the wave in motion End //Pulse

td_xsetoutwave(0,"0%event,0%event", "b%Output", ThePulse, Decimation).

Page 311: MFP3d Manual 04 08
Page 312: MFP3d Manual 04 08

ThermalDCSetVar_1

ARExecuteControl("SweepWidthSetVar_1","MasterPanel",Zoom,num2str(Zoom))

ARExecuteControl(ControlName,GraphStr,VarNum,VarStr)

Page 313: MFP3d Manual 04 08
Page 314: MFP3d Manual 04 08

Function AutoInvols(CantileverType) String CantileverType //gets the cantilever type from the user and feeds the parameters from the //cantilever to //NonContactKCalk Variable Length, Width, EstimatedFreq //cantilever dimensions Variable Zoom Variable FitWidth //Zoom width for the fit guess. This has to be bigger //for higher spring constant cantilevers Print "" //the If switch will put information about our cantilever into some variables //then if we get to the end of the function //we will use that information to calculate the Invols without touching the surface. if (StringMatch(CantileverType,"AC240")) Length = 240e-6 // units are meters

Page 315: MFP3d Manual 04 08

Width = 30e-6 EstimatedFreq = 65e3 Zoom = 100e3 //units are in Hz elseif (StringMatch(CantileverType,"AC160")) Length = 160e-6 //meters Width = 30e-6 EstimatedFreq = 300e3 //Units are Hz Zoom = 150e3 //these units are in Hz ---need a wider Zoom since there is more //variation in the freq of ac160s elseif (StringMatch(CantileverType,"Biolever60")) Length = 60e-6 //meters Width = 30e-6 EstimatedFreq = 37e3 //Units are Hz Zoom = 74e3 //these units are in Hz elseif (StringMatch(CantileverType,"Biolever100")) Length = 100e-6 //meters Width = 30e-6 EstimatedFreq = 13e3 //Units are Hz Zoom = 26e3 //these units are in Hz elseif (StringMatch(CantileverType,"NCH")) Length = 125e-6 //meters Width = 30e-6 EstimatedFreq = 320e3 //Units are Hz Zoom = 150e3 //these units are in Hz elseif (StringMatch(CantileverType,"NCL")) Length = 225e-6 //meters Width = 38e-6 EstimatedFreq = 190e3 //Units are Hz Zoom = 60e3 //these units are in Hz elseif (StringMatch(CantileverType,"FM")) Length = 225e-6 //meters Width = 28e-6 EstimatedFreq = 75e3 //Units are Hz Zoom = 60e3 //these units are in Hz elseif (StringMatch(CantileverType,"ArrowNC")) Length = 160e-6 //meters Width = 345e-6 EstimatedFreq = 285e3 //Units are Hz Zoom = 90e3 //these units are in Hz

Page 316: MFP3d Manual 04 08

elseif (StringMatch(CantileverType,"ArrowFM")) Length = 240e-6 //meters Width = 35e-6 EstimatedFreq = 75e3 //Units are Hz Zoom = 70e3 //these units are in Hz elseif (StringMatch(CantileverType,"Silex1")) Length = 40e-6 //meters Width = 5e-6 EstimatedFreq = 70e3 //Units are Hz Zoom = 135e3 //these units are in Hz elseif (StringMatch(CantileverType,"Silex2")) Length = 15e-6 //meters Width = 5e-6 EstimatedFreq = 350e3 //Units are Hz Zoom = 200e3 //these units are in Hz elseif (StringMatch(CantileverType,"Silex3")) Length = 12e-6 //meters Width = 5e-6 EstimatedFreq = 550e3 //Units are Hz Zoom = 200e3 //these units are in Hz else Print "unknown cantilever" Dump() //dumps you and Prints an error message with some guidance on cantilevers return(0) //leave before we try to calculate things. endif //Finally, use the information. FitWidth = Zoom NonContactKCalc(Width, Length, EstimatedFreq, Zoom, FitWidth) End //AutoInvols

Function NonContactKCalc(Width,Length,EstimatedFreq, Zoom, FitWidth) Variable Length, Width, EstimatedFreq, Zoom, FitWidth //this will be a shell that calls the different cases for the NonContactKCalc // it also enters the values needed into the

Page 317: MFP3d Manual 04 08

various control panels String SavedDataFolder = GetDataFolder(1) //Store the current data folder (SavedDataFolder): grabs //the current data folder and assigns it to a //String so that it can be restored //after each macro or function is executed. //This could probably be made into a function. ARExecuteControl("DriveFrequencySetVar_1","MasterPanel",EstimatedFreq,num2str(EstimatedFreq)) ARExecuteControl("SweepWidthSetVar_1","MasterPanel",Zoom,num2str(Zoom)) ARExecuteControl("FitWidthSetVar_1","MasterPanel",FitWidth,num2str(FitWidth)) SetDataFolder root: //CasesForNonContactCalc(Width, Length, EstimatedFreq, "FirstDoAThermal") Execute/P/Q "CasesForNonContactCalc("+num2str(Width)+","+num2str(Length)+","+num2str(EstimatedFreq)+",\"FirstDoAThermal\")" SetDataFolder SavedDataFolder End //NonContactKCalc

Function CasesForNonContactCalc(Width, Length, EstimatedFreq, CycleCase) Variable Length, Width, EstimatedFreq String CycleCase //this will cycle thru the cases to first get the thermal tune done, //then call the kSader Function Variable freak //resonance frequency from thermal

Page 318: MFP3d Manual 04 08

Variable kyoo // q factor from thermal Variable KaySader Variable InvolsGuess Variable InvolsCorrect Variable KayThermalTune

StrSwitch(CycleCase) // String switch case "FirstDoAThermal": // execute if case matches expression String Callback = "CasesForNonContactCalc("+num2str(Width)+","+num2str(Length)+","+num2str(EstimatedFreq)+",\"NextDoSader\")" //Callback = "CasesForNonContactCalc(Width,Length,\"NextDoSader\")" -- this was the first try. obviously doesn't work //Callback = "CasesForNonContactCalc(" //Callback += num2str(Width) //Callback += "," //Callback += num2str(Length) //these break down the steps to create the Callback statement...pain in the ass, but clear //Callback += "," //compared to the way above where all the steps are combined //Callback += num2str(EstimatedFreq) //Callback += "," //Callback += "\"NextDoSader\"" //Callback += ")" //Print Callback RunARMacro("DoAThermal",Callback=Callback) //Print "made it this far first case" break // exit from switch case "NextDoSader": // execute if case matches expression freak = GV("ThermalFrequency") kyoo = GV("ThermalQ") InvolsGuess = GV("Invols") KayThermalTune = GV("SpringConstant")

Page 319: MFP3d Manual 04 08

//Print "made it this far second case" KaySader = kSader(Width,Length,kyoo,freak) InvolsCorrect = InvolsGuess*(sqrt(KayThermalTune/KaySader)) Print "InvolsGuess= ", InvolsGuess, "m/V" Print "thermalQ= ", kyoo Print "thermal frequency= ", freak, "Hz" Print "estimated frequency= ", EstimatedFreq, "Hz" Print "spring constant by Sader method, k = ",KaySader, " N/m" Print "the inVOLS is: ", InvolsCorrect, "m/V" Print "" ARExecuteControl("InvolsSetVar_2","MasterPanel",InvolsCorrect,num2str(InvolsCorrect)) break default: // optional default expression //executed Print "something screwed up" // when no case matches EndSwitch End //CasesForNonContactCalc

Function Dump()

Print "please enter a known cantilever and start the function again" Print "known cantilevers are AC240, AC160, NCH, NCL, FM, ArrowNC, ArrowFM, Biolever100, Biolever60 and Silex levers."

Page 320: MFP3d Manual 04 08

Print "a description of each of these can be found on our website http://www.rasy.com/Products/Levers/LeverGuide.shtml" Print "note that coated cantilevers are referred to by their uncoated counterpart's designation for this function" Print ""

End //Dump

Page 321: MFP3d Manual 04 08