Home

thesis2 - AUS Masters Theses

image

Contents

1. acquired per channel the Start function to start the acquisition all of the waveform data the Clear Task function to clear the task Display an error if any I O Connections Overview Make sure your signal input terminal matches the Physical Channel I O Control For further connection information refer to your hardware reference manual Note Je FRA RR RR RR RR RR RR RR RR AAA AA RRA kk KR OK OK OK OK OK OK RK RK RK RK RRA f Appendix C DAQ Code 191 include lt C Program Files Microsoft Visual Studio vc98 Include stdio h gt include lt C Program Files Microsoft Visual StudioNVC98MIncludeMstdlib h include lt C Program Files Microsoft Visual Studio VvC98 Include string h gt include lt C Program Files Microsoft Visual Studio vc98 Include cstring gt include lt NIDAQmx h gt define DAOmxErrChk functionCall if DAQmxFailed error functionCall goto Error else int main void int32 error 0 TaskHandle taskHandle 0 TaskHandle task 0 float64 al4 float64 photo 1000 4 int32 value uInt8 data 8 0 0 0 0 0 0 0 0 char errBuff 2048 0 int i k m fh FILE fin KKK IK OK KK OK OK kck ckckckckckokckokckckckckckck okckock ck f DAQmx Configure Code Voltage Acquisition KKK IK OK KK OK OK KOK OK RARAS DAOmxErrCh
2. i_tst_min find MSE_test min MSE_test Nw_min_MSE_test Nw i_tst_min Appendix A Matlab Codes 148 o o o o o o o o o o o O 9 9 O 9 9 O O O O O 9 O O O O O O O O O O O O O O O 9 9 9 9 9 O 9 BD O 9 9 9 9 9 O O O O O 9 O O O O O O O o o o o o o o o o o o o o o o o o o o o o o o o o o e o o o o o o o o o o o o o 9 9 9 D O 9 2 2 9 o o onp oen 9 0 9 2 2 2 9 D O 82 0 0 9 0 9 G O o 0 O 0 9 9 O 2 8 2 0 29 ano 0 9 9 9 9 o o o oo o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o inding the MSE value after with gaps and testing for experimental data set at x 0 cm filenam wavenet52 reverse testing m o o9 o oe oe e o9 Ae o9 oe oe e o Ae Ae oe oe o 9 2 Q 9 O O O Q 9 O O O D O 0 O D 9 O O O 9 O O O 9 O O O Q D O 2 O D 9 O O D D O O Q D O O O O O O O D D O O O D O O O O o o o o o o o o o o D 0 0 9 O 0 Q D O D O O O O Q O O O D O O 0 O O OQ O O O O O O O O O O 0 O O O O O O O O O O Q O 0 0 O O O DO 0 0 O G o o o o o QA QA a load RP simulated data gaps w gaussian N1 6 Nw 63 gamma 0_99 loops 10to5 testing 0 divx 0 05 divy 0 02 load inoutexp 9 9 9 9 9 9 9 9 goo g o 9 9 o o o e o
3. for loops 1 iterations loops oe Feedforward algorithm o oe oe oe oe PHI ones 1 Nw Np for j 1 Nw for i 1 Ni z j i 2 x i m j i d j i phi j i z j i xexp 0 5 z j i 2 phi p j i PHI 1 3 PHI end end z jr i 2 1 xexp 0 5 z 3 1 2 Z I l j phrz j l H Appendix A Matlab Codes 141 Use squeeze command on PHI to reduce it from a 3D to a 2D matrix PHI squeeze PHI Batch computation of the wavelet network output Y hat using the feedforward equation Y_hat Woh PHI Woixinput Computing the error E between the desired output Y Sand the WN output Y hat E Y Y hat Computing the sum of square error SSE SSE sum sum E xE Computing the mean square error MSE for every iteration MSE loops SSE Np oe Backpropagation algorithm o o9 oe oe oe for k 1 No DWoi k 1 E k u end for k 1 No for i 1 Ni DWoi k itl E k u x 1 end end for k 1 No for j 1 Nw DWoh k 3 E k u PHI 3 end end for 3 1 Nw for i 1 Ni P phi j P l i phi p j i PHI p j i 7prod P end end for j 1 Nw for i 1 Ni EDmy zeros 1 1 Np EDdy zeros 1 1 Np for k 1 No p squeeze PHI p j i Dmy k 2 Woh k 3 d j i p zz squeeze z j i Ddy k Dmy k zz eDmy 1 1 E k xDmy k eDdy
4. o P1 Experimental data A P1 WN test output o o o P PO P3 Experimental data 0 8 NE D P3 WN test output E vo U yo L1 0 6 Mo yal xo 0 4 4n AL 0 2 so 0 SoS ect 0 5 0 5 Normalized Power Normalized Power P2 Experimental data ge i 0 8 O P2WN test output od i 9 Q 0 6 o of n 04 2 of g 0 2 O 0 NUR 0 5 0 0 5 y cm 1 P4 Experimental data 0 8 PAWN test output 0 6 0 4 0 2 O opio pk mi e nk epi ne ni dei pm 0 5 0 0 5 y cm Figure 5 17 Comparing the WN test output and the experimental data for vertical scanning at x 0 55 cm The resolution for the x data used in the training is 0 1 cm and the resolution for the y data used in the training is 0 02 cm 5 2 Training and Testing of Wavelet Network 94 Next we studied the performance of the WN when the experimental data sets at x 0 55 cm x 0 cm and x 0 55 cm were used for testing The experimental y data used for testing was within the range of 0 5 cm and 0 5 cm The test errors obtained were 7 91e 02 7 14e 02 and 2 66e 02 for the vertical scans at x 0 55 cm x 0 55 cm and x 0 cm The performance of the WN was further investigated by using the data set at x 0 cm for testing and the theoretical model with vertical gap 6 0 3 cm and horizontal gap e 0 1 cm for training The resolution for the x positi
5. 1 a sn 6 A sin 4 2 Theoretical Optical Acquisition Model 53 Therefore A can be stated as sin A Arco eh es no sin B1 4 20 Hence Asy the total area of the shaded region can be written in the following closed form Ay A A5 f f ota f NEL eS z T Py B sin OL e sin Br 7 za armes cos e QU sin sin B1 J 4 21 4 2 1 Modeling Optical Apodization The optical power enclosed within a certain area of intersection is derived for three different cases the power as the beam moves along the z direction only the y direction only and both x y directions The power for horizontal motion can be evaluated using the following double integral a2 ppa o W 2 2p P Tre A ae ae 4 22 LL Lares ee arty oo 422 Let Wo Y s a 4 23 pala po 4 24 po E 4 25 Therefore using the above definitions equation 4 22 can be written as a2 pala 2 Bel exp 5 pdpdo 4 26 ar pi o 4 2 Theoretical Optical Acquisition Model 54 Let 2 2 4 27 where 2 Ug u p2 po yar 2 OE NT 2 1 0 i 1 sina W2 sina Taking the derivative of u with respect to p we have 4 du pdp 4 28 W z Substituting equations 4 27 and 4 28 into equation 4 26 and taking the limits uz and u1 we have the following Q2 U2 2 Bees h 9 c 2 duda a1 ui a SY exp wnt da o1 a2 ah I BY
6. then equations 48 and 49 can be rewritten as Np No 1 Ckj Amy 1 gt PST E 7Amp l 1 52 ji and pap Ck Adj D 57 gt S pel sea 4Ad 1 1 53 P p 1 k 1 d As can be seen from equations 52 and 53 to evaluate Amy 1 and Ad 1 we need to first find Let PHI p bea 3D array with N pages where 3 Backpropagation Algorithm 182 each page consists of the following matrix Of i mE of mE y 5 5 ms 5 d Oy Pl A M 54 QA d 45 o QN 1 QN 2 dbi DN i a DN Using equation 23 the page vector can be evaluated as follows 51 P 52 Ds 5 Pj Pj Dji Aca PIN 55 ji ji The following block of code is used to evaluate the components of the 3D array for 3 1 Nw for i 1 Ni P phi j P 1 i phi_p j i PHI_p j i prod P end end When entering the for loop at the ith and jth iteration we first set P phi 3 where P is a 3D array with N pages where each page consists of the row vector eh pla Sei e N Next the page vector of P at the ith column is replaced by pj using P 1 i phi p j i Therefore the new 3D array P has each page consisting of the row vector with the fol lowing components Yio e boe Pon Thus the command 3 Backpropagation Algorithm 183 PHI p j i prod P computes the product of each row vector for all the pages of P to produce the single page vector ji For the next it
7. 0 55 cm and x 0 55 cm The resolution for the x data used in the training is 0 1 cm and the resolution for the y data used in the training is 0 02 cm o Comparing the WN test output and the experimental data for vertical scanning at r 0 55 cm as a function of time The resolution for the x data used in the training is 0 1 cm and the resolution for the y data used in the training is 0 02cm Comparing the WN test output and the experimental data for vertical scanning at x 0 55 cm as a function of time The resolution for the x data used in the training is 0 1 cm and the resolution for the y data used in the training is 0 02 em 2 6 be ee ee eee ees Comparing the WN test output and the experimental data for vertical scanning at x 0 cm The resolution for the z data used in the training is 0 1 cm and the resolution for the y data used in the training is 0 02 Comparing the WN test output and the experimental data for vertical scanning at r 0 cm as a function of time The resolution for the x data used in the training is 0 1 cm and the resolution for the y data used m the training is 0 02 cm uu ouo ok See x OR m m x Ew Comparing the WN test output and the experimental data for vertical scanning at r 0 55 cm The resolution for the x data used in the training is 0 1 cm and the resolution for the y data used in the training vill 87 87 89 89 90 90 91 81 92
8. Z J 1 exp 0 5x z j i 72 phi p j i 9 z j i 2 1 exp 0 5 z 3 i PHI 1 j PHI 1 j phi j i end end PHI squeeze PHI Y_hat_tst Woh PHI Woixinput tst E Y test Y hat tst SSE sum sum E xE MSE SSE Np t 0 length Y test 1 1 figure 3 subplot 1 2 1 handlevector 1 plot t Y_test 1 1 f end 2 22 LineWidth 2 Color 0 0 0 DisplayName Experimental data hold on handlevector 2 plot t Y hat_tst 1 f 1 f end Marker o LineStyle none Color 0 0 0 DisplayName WN test output axis 0 30 0 6 0 6 xlabel t s ylabel x cm legend handlevector 1 2 subplot 1 2 2 handlevector 1 plot t Y test 2 f 1 f end LineWidth 2 Color 0 0 0 DisplayName Experimental data hold on handlevector 2 plot t Y_hat_tst 2 f 1 f end Marker square LineStyle none Color 0 0 0 DisplayName WN test output axis 0 30 0 6 0 6 xlabel t s ylabel y cm legend handlevector 1 2 150 Appendix A Matlab Codes oo o oo oo oe oe oo oo oo oo oo oo oo oe oo oe o oo oo o oo oo oe oo oe oo oo oo oo oo oo oo oo oo oo oe oo oo oo oo oo oo oo oo oo oo oo oo oo oe oo oo oo oo oo oo oo oe oe oo oo oo oo oo oo oe oo oo oo oo oo oo oo
9. 2 Qy beta exp ky sin beta 2 Fx quad Qx phi pi 2 alpha2 Fy quad Qy pi phi beta2 Pxy AAx BBx pi 2 alphal betal Ex Fy Fxx quad Ox alphal alpha2 PX AA BBx alpha2 alphal Fxx Fyy quad Qy betal beta2 Py AAx BBx beta2 betal Fyy Coordinates of the center of the circle xn yn are located in Region 1 2 3 or 4 if xn gt xo amp yn yo xn xo amp yn lt yo xn xo amp yn gt yo xn lt xo amp yn lt yo Power Pxy oe oe o oe Coordinates of the center of the circle xn yn are located in Region 5 6 7 or 8 elseif xn xo amp yn lt yo amp yn 0 xn xo amp yn yo amp yn lt 0 xn lt xo yn lt yo amp yn gt 0 xn lt x0 amp yn gt yo amp yn 0 if length c 1 amp length xint if dx 0 amp dy Power Pc 4 else o oe o oe Power Px Pxy end elseif length c 0 length xint Power Px end Coordinates of the center of the circle xn yn are located in Region 9 10 11 or 12 lseif yn gt yo amp xn lt xo amp xn gt 0 yn gt yo amp xn xo xn 0 yn lt yo amp xn lt xo amp xn gt 0 yn lt yo amp xn gt x0 amp xn 0 if length c 1 amp length xint if dx 0 amp dy o oe o oe oO Appendix A Matlab Codes 131 Power Pc 4 else Power Py Pxy end elseif length c 0 length xint Power Py end ol C
10. 2 38 and 2 39 we have FQ Sper EG ee 2 40 d y gehe p gee 2 41 hg hte ett 2 42 The terms with negative exponentials indicate a wave traveling in the positive x y Or z direction while the terms with positive exponentials result in waves traveling in the negative direction For our present discussion we will select a wave traveling in 2 3 Wavefronts 19 the positive direction for each coordinate U r f zx g y h z fess gte tk aera erg exp 73 ksx kyy k 2 Aexp j k z kyy k z Let us define a wavenumber vector k k ky y k ko where ko I Vi k2 k and fi is a unit vector in the direction of propagation In addition we will define a position vector T r y z z such that the dot product k F kaz kyy k z Therefore the plane wave U r can be stated as follows U r Aexp sk 7 2 43 where A is a complex constant called the complex envelope and the phase arg U r arg A k F If the plane wave is propagating along the positive z axis U r Aexp jkz only and assuming arg A 0 the corresponding wavefunction will be u r t A cos 27 ft kz 2 44 To maintain a fixed point on the wave 27 ft kz constant one must move in the positive z direction as time increases as if following a fixed point on the wave The velocity of the wave in this sense is called the phase velocity vp because it
11. GOA AAA do Md X qo Hp sp s BD wd ay i a noc 0 0 OA OAR 3 a tU T St DN Sot BO y l p Q 6 Q QU OQ Ped n e gt SB Pops El O YH 2h H x BH X u O oe ge de go oe oe Ow oe H E aan dq ag ag Ug Oc X X gt gt IS dq DD QQ so ssa x X B ou non on n c CN H CN 4 gt gt XX Bp pp y GG ce d O X x gt gt Y isreal 0 1 otherwis isreal SIf the elements are real MOM OM OM ANA DK Xx ous au 30 o c X X D M wg 0 000 guun nn nN rd eb ocn VOTO MMM M Ce ON AN PX M X X mm oa a a end SReplace the imaginary values by twice the dimensions of the square eS 2 xo 2 xXO 2 yo 2 yo xatyl find nxyl 20 E xaty2 find nxy2 0 FK yat xl find nyx1 0 r yatx2 find nyx2 0 Appendix A Matlab Codes 111 oe Taking the xatyl with in the range xo lt x lt xo xl find xatyl lt xo amp xatyl xo Taking the xaty2 with in the range xo lt x lt xo x2 find xaty2 lt xo xaty2 xo Taking the yatxl with in the range yo lt y lt yo yl find yatxl lt yo yatxl yo o Ul Taking the yatx2 with in the range yo lt y lt yo y2 find yatx2 lt yo yatx2 yo u o LI oe LI Setting initial values to xa xb xc xd xa i xb i xc x1 xd x2 Setting initial values to ya yb yc yd ya yl yb y2 yc i yd i Ck CkCk ck ckck ck ck ckck ck ck ck ck ck ck ck ck ck ck ck
12. P else if Case 11 y 0 then The power of the shaded region is P Pr else if Case 12 y y gt yo po then The power is P 0 4 2 Theoretical Optical Acquisition Model 58 d e f Figure 4 5 a Case 1 x gt zo b Case 2 z lt xo c Case 3 0 x zo d Case 4 zo z lt 0 e Case 5 x 0 f Case 6 z gt Lp po d e P Figure 4 6 a Case 7 y gt yo b Case 8 y lt yo c Case 9 0 lt y lt yo d Case 10 yo lt y 0 e Case 11 y 0 f Case 12 y y gt yo po 4 2 Theoretical Optical Acquisition Model 59 Finally as the beam is moved along both the x and y directions over the entire plane of one photocell the power can be stated as Iu P P 4 35 02 Po Ba po f eodd ff l p z pdpdB 4 36 5 x T Y py where p x ro sin o and py y yo sin B To evaluate P we proceed in the following manner Bj f 10 3vdpda T 5 pela a2 po Wo Y 2p f i eese exp pdpda W z W z T 5 pela a2 PO sy E Md 4 37 h exp W3 z pdpda 3 pala Substituting equations 4 27 and 4 28 into equation 4 37 and taking the 4 2 Theoretical Optical Acquisition Model 60 limits uz and u1 we have the following Pi nf fons u JE dudo ots vi 2 E 5 exp u do 0 3 a2 W 2 n f 5 exp u2 exp u1 da 9 3 f WN or
13. a Z t Z is used for the discretization where the scalar parameters dy and mg define the step sizes of dilation and translation discretizations Wavelet bases have numerous applications in signal processing and numerical analysis because they offer very efficient algorithms and provide more useful informa tion than Fourier transform However it is not always possible to build orthonormal wavelet bases with any wavelet function Y Though there are some well developed techniques for constructing the wavelet function 4 and its associated orthonormal basis the wavelet function w has to satisfy strong restrictions These restrictions lead to conflicts between regularity and com pactness of the wavelet function both being desired properties Furthermore if one gives up the idea that the discrete family in equation 3 8 should be a basis of some considered functional space and requires only that equation 3 8 constitutes a frame then one gains more freedom on the choice of v 20 Wavelet frames are redundant basis constructed by simple operations of trans lation and dilation of the mother Wavelet which must satisfy conditions less stringent than their orthonormal counterparts The frame condition can be stated as follows there exist two constants Cmin gt 0 and Cmax lt oo such that for all f L R the following inequalities hold d AS s e S eae Js 3 9 pjENe In this sum f denotes the
14. dd dd 4 p dmi p dm didi diis dd dd 2 p dmi p dm dm p dmy dd dd dd dd ji wi dd N ddy 63 dd dd y i 3 Backpropagation Algorithm 187 Next let us define the matrices Dm aver Dm and Dd_aver Dd as follows dmi ding dina dim4 w Din 64 dmi dim din din n dmw i dmyw dT dT NoN and ddi ddz dd ddin ddai dd33 dd dd y Dd E E 65 dd ddjz dd ddin ddn ddy 2 ddn i ddn n The matrices Dm and Dd are computed using the following code for j 1 Nw for i 1 Ni Dm_aver j i mean Dm j 1i Dd aver j i mean Dd j i end end In matrix form equations 52 and 53 can be stated as follows Am 1 Dm yAm J 1 66 and Ad I Dd 4Ad L 1 67 3 Backpropagation Algorithm 188 where Ami 1 Am 1 Ami 1 NAA Amin 1 Amy lI Amax 1 Ama l Aman 1 An l 68 Amp 1 Amj l Ama Amyn 1 Amy 1 1 Amy 2 1 ae Amy i 1 uds Am N N 1 and Ady UD Ad D Adul Ady 0 Ada 1 Ades D Ada I Adan Ad 1 s E Ts 69 Adi l Adj l Adj I Adin 1 Adwy i D Ady 2 D Adwn i I Adw w 0 Using Deltam Am I and Deltam_old Am l 1 equation 66 can be computed as follows Deltam Dm_avertgammaxDeltam_old Similarly using Deltad Ad l and Deltad_old Ad I 1 equ
15. pi 2xalpha sin 2xalpha Area Ac Al Case 5 Centre of circle between xo and 0 left half of square elseif xn lt 0 amp xn xo d xo xn alpha asin d r A1 r 2 2 pi 2xalpha sin 2xalpha Area Ac Al end end Appendix A Matlab Codes 118 o oe o oe oe oe o oe oe oe oe oe o oe o oe o oe o oe o oe o oe o oe oe oe o oe oe oe oe oe o oe o oe o oe o oe o oe o oe o oe oe oe o oe oe oe o oe o oe o oe o oe o oe o oe o oe o oe oe oe o oe o oe oe oe o oe o oe o oe o oe o oe oo oe oe oe o oe o oe o oe o oe o oe o oe o oe oe oe o oe oe oe o o o o o X o9 cP o o o o oe oe o oe o o o o o o o o9 o9 AP oe oe oe oe o o o o oe o o o oe o o AP oe oe o oe o oe Q w E Q fun E w 0 ct y 0 w H 0 ge O Fh ct B 0 Function to overlap between circular beam spot and the square photocell Center of circular beam spot is moving along the y axis while the square photocell is fixed at the origin of the coordinate system Given diameter of the circular beam spot is equivalent to one side of the square photocell o o o o o A o o o o o o oe oe o o o o o o o9 o AL AL AP AL oe oe AP o o9 o9 o o AL o AL AL AL AY AY oe 1 8 T filename AREAY2 m Written by Yasmine El Ashi Fall 2007 0 00000000000000000000000000000000000000000000000000000
16. sin 204 4 5 2 Next to find the intersection area A as the beam moves along the y axis only as shown in Figure 4 4 the following parameters were defined dy y yo 4 6 4 2 Theoretical Optical Acquisition Model 48 Figure 4 3 Parameters definition for area Ay which is the vertical distance between the spot center and the side at which the circular spot intersects the square In addition we have sin 3 sin f 2 a 4 7 Po where 3 is the angle between the horizontal axis crossing through the center of the beam and the first intersection between the circular spot and the square photocell While 5 is the angle between the horizontal axis crossing through the beam center and the second point of intersection Using G2 7 1 p1 0 y yo sin B and 4 2 Theoretical Optical Acquisition Model 49 P2 3 po the intersection area A is evaluated as follows B2 pa 8 Ay f pdpd i p B ie X AS j Ba 2 2 po sin 8 Bi Ba 2 250 Po sin 0j ie d 2 sin E Bi po po 2 T 1 r 261 c d 2 v 281 j 8H Bi f E B o1 po po B 7 m 281 y Sin Bi cot Bg po po vU T 261 y Sn Bi cot 95 cot 61 2 2 m T 261 e sin f 2 cos 5 po F t 20 sin 261 Therefore the area A can be stated as B2 pp2 8 Ay 1 f pdp dp Br Jp1 6 i r 28 sin 261 4 8 To derive the area of inte
17. yo and centre of circle s 2 y2 yn t 2 n corner4 xo yo and centre of circle s 2 y2 yn t 2 Corners of square inside the circle Area feval AREAXY2 r Xn Yn xint yint xo yo C area s t Area figure mesh xn yn area xlabel xn ocm ylabel yn cm zlabel Area of overlap position of beam spot center along xy directions cm 2 110 Appendix A Matlab Codes oe oo oo oo oe oo oo oo oo oo oo oo oo oe oo oo oo oo oo oo oo oo oe oo oo oo oo oo oo oo oo oo oo oo oo oe oo oo oo oo oo oo oo oo oo oo oo oo oo o oo oo oo oo oo oo oo oe oo oo oo oo oo oo oo oo oo oo oo oe oo oo oo oo oo oo oe oo oo oo oe o oo oo oo oo oo oo oo oe oo oo oe oo oo oo oo oo oo oo oe oo oo oo oo oo oo oo oo oo oo oe oo oo oe oo oo oo oo oo oo oo oe oe oo oo oo oo oo oo oo oo oe 55 overlap between the circular beam spot and the square oe oo oo 55 photocell as the beam scans the plane of the photocell o oe oe o oe oe o A oe c Oo N H Ey E x e d El n pen O u En Q E e U o y E A E n n 2 pal Pal Q E a 6 o E p E y H Em oe oe oe ae oe oe o oe oe oe oo oo oo oe oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo op oo oo oo oo oo oo oo oo oo oo oo oo oo oo o
18. 69k a xo Gud KS 3 Backpropapalion Algorithm ccoo press press ds es 3 1 Updating the parameters of Woi 3 2 Updating the parameters of Won 9 8 Updating the parameters of m and d Appendix C DAQ Code Appendix D Microcontroller Code VITA 43 43 44 53 64 69 69 74 81 83 84 99 101 102 105 152 152 153 Tor 167 173 174 178 180 190 194 219 List of Figures 2 1 A vibrating string at an instant of time the quantities shown are used in the derivation of the classical one dimensional Wave equation 15 9 2 2 Representation of a monochromatic wave at a fixed position r a the wavefunction u t is a harmonic function of time b the complex amplitude U a exp jy is a fixed phasor c the complex wavefunc tion U t U exp 27 ft is a phasor rotating with angular velocity prm tadians s I3 e e e anios ana RR RUE a A 15 2 3 a The magnitude of a paraxial wave as a function of the axial distance z b The wavefronts and wavefront normals of a paraxial wave 13 21 2 4 Gaussian beam model for the laser source used in the proposed system 26 2 5 The normalized Gaussian intensity profile 2i 3 1 a Single neuron model b Simplified schematic of single neuron 25 32 3 2 Feedforward neural network 25 33 33 Graph of yo Y xe 26 loses 36 3 4 Graph of pss OL a wee GARE RUE
19. 92 93 5 18 5 19 5 20 5 21 5 22 5 23 5 24 5 25 5 26 Comparing the WN test output and the experimental data for vertical scanning at r 0 55 cm The resolution for the x data used in the training is 0 1 cm and the resolution for the y data used in the training 15 0 02 GIRL oe Ghee ms a ee ee RR ee a ee Comparing the WN test output and the experimental data for vertical scanning at x 0 cm The resolution for the z data used in the training is 0 1 cm and the resolution for the y data used in the training is 0 02 Comparing the MSE values vs N after training the theoretical model with gaps and after testing for the theoretical data set at x 0 cm The resolution for the x data used in the training is 0 05 cm and the resolution for the y data used in the training is 0 02 cm Comparing the WN test output and the theoretical model with gaps for vertical scanning at x 0 cm The resolution for the x data used in the training is 0 05 cm and the resolution for the y data used in the training is 0 02 OHNE sra rara fo Sos pos ed e Comparing the WN test output and the theoretical model with gaps for vertical scanning at z 0 cm as a function of time The resolution for the z data used in the training is 0 05 cm and the resolution for the y data used in the training is 0 02cm Comparing the MSE values vs N after training the theoretical model with gaps and after testing for the experimen
20. colorbar figure Plot of PS3 vs position of centre mesh xc yc PS3 xlabel x cm ylabel y cm zlabel Normalized Power colorbar figure SPlot of PS4 vs position of centre mesh xc yc PS4 xlabel x cm ylabel y cm zlabel Normalized Power colorbar amp abs V Yc 4 1 x0 001 gt 0 amp abs V Yc 4 nyc lt 0 001 of beam spot of beam spot of beam spot of beam spot Appendix A Matlab Codes 134 o o o o e o O 9 9 O O 9 O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O o o o o o o o o o o o o 2 9 9 0 0 9 O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O 9 O O O 9 o o o o o o o o o o o o o o o o o o o culation program for a quad cell photodetector array at different values for epsilon and a while moving the beam spot along both the x and y axis Epsilon and A are assumed to be equal filename Quadcell POWER modifiedfurther m o o o o o oe oe e o9 o o o o oe oe o9 o9 AP o o9 o oe o o o O 9 9 O 9 9 O O O O O O O O O O O O O O O O O O O 9 O O9 9 9 9 9 9 9 O O O O O O O O O O O O O O O O O O O O
21. July 1989 Q Zhang and A Benveniste Wavelet Networks IEEE Transactions on Neural Networks vol 3 no 6 Nov 1992 T Kugarajah and Q Zhang Multidimensional Wavelet Frames EEE Transactions on Neural Networks vol 6 no 6 Nov 1995 BIBLIOGRAPHY 104 25 26 27 28 29 30 31 32 33 Y C Pati and P S Krishnaprasad Analysis and Synthesis of Feedfor ward Neural Networks Using Discrete Affine Wavelet Transformations Technical Research Report of the University of Maryland TR 90 44 A Boggess and F J Narcowich A First Course in Wavelets with Fourier Analysis New Jersey Prentice Hall 2001 Y Oussar and G Dreyfus Initialization by Selection for Wavelet Net work Training Neurocomputing vol 34 pp 134 143 2000 Q Zhang Wavelet Network The Radial Structure and an Efficient Ini tialization Procedure in European Control Conference ECC Gronin gen Pays Bas 1993 A E Siegman Lasers University Science Books 1986 Y El Ashi R Dhaouadi and T Landolsi Design of a novel optical vibrometer using Gaussian beam analysis in Proc 5th International Symposium on Mechatronics and its Applications ISMA08 Amman Jordan May 27 29 2008 Y El Ashi R Dhaouadi and T Landolsi Accuracy of a Gaussian Beam Optical Vibrometer with a Quad Photodetector Spatial Separa tion Proc of 3rd International Conf on Modeling Simul
22. PORTB of the microcontroller data 7 0 Appendix C DAQ Code 192 a7 DAOmxErrChk DAQmxWriteDigitalLines task 1 1 10 0 DAQmx_Val_GroupByChannel data NULL NULL for k 0 k lt 75 k DAOmxErrChk DAQmxReadAnalogF 64 taskHandle 1 10 0 DAQmx Val GroupByChannel a 4 amp value NULL DAOmxErrChk DAQmxWriteDigitalLines task 1 1 10 0 DAQmx_Val_GroupByChannel data NULL NULL photo k 0 a 0 photo k 1 a 1 photo k 2 a 2 photo k 3 a 3 data 0 1l data 0 for m 0 m lt 50000 m for n 0 n lt 10000 n m m 40 de 0 50 Oo I DAOmxErrChk DAQmxWriteDigitalLines task 1 1 10 0 DAQmx Val GroupByChannel data NULL NULL KKK KKK KKK KEK KKK KKK KKK KEK KEKE KK ckckckokckckckckckckckckckck ck k f Save results in the file PD kk ck koe ck koe ck IK OK IK OK OK KK OR KK kK ck Y for i 0 1 lt 75 i fprintf fin f f grin photo i 0 photo i 1 photo i 2 photo i 3 Kk kk ck kk ck koe ck KK KOK KOK OK KK KK ek Close the file KKK IK OK IK KOK OK KOK KK KK ek fclose fin Error if DAQmxFailed error DAQmxGetExtendedErrorInfo errBuff 2048 if taskHandle 0 TK KKK KK RK RK RK RK RK ck ckckck ck ck ck ckckck ck ckck ck ck ck ckck ck kock ok DAQmx Stop Code Reading function J kk KKK RK RK RK RK RK ckckckckckckck ck ck ck ck ckck ck ckck ckckck ckck RRA DAOmxStopTask taskHandle DAQmxClearTask tas
23. Rs is the load resistance While R provides an estimate of the amount of photocurrent ipn expected at a certain wavelength A iph PopiR 4 43 According to typical responsivity curve for photodiode FDS1010 using Thor labs calibration services we have a R 0 35 A W for a wavelength of 633 nm 33 Therefore given a linear relation between the photocells optical power and acquired output voltage the experimental normalized voltage measure ments were compared to the theoretical model obtained through simulation by setting e and 6 to 0 1 cm and 0 3 cm At x 1 05 cm theoretically only photocell 1 will be detecting power as the y position of the beam center y gt 0 35 cm and maximum power which is half of the total normalized power is detected at y 0 65 cm Photocell 4 starts to pick up power for y lt 0 35 cm and captures half of the power at y 0 65 cm According to Figure 4 24 the maximum normalized voltage for photocell 1 was reached at y 0 71 cm with a voltage percentage error of 4 3 Experimental Study of the Position Detector 76 3 72 from the theoretical maximum value On the other hand photocell 4 acquired maximum voltage at y 0 77 cm with a voltage percentage error of 3 86 In the case where x is fixed to 1 05 cm only photocell 2 will be detecting power for y gt 0 35 cm while the power reaches its peak value at y 0 65 cm In addition according to the theoretical results photocell 3 detects
24. Xc 4 1 gt 0 amp abs V Xc 4 1 lt 0 001 vx 4 2 find abs V Xc 4 nxc gt 0 amp abs V Xc 4 nxc lt 0 001 vy 1 1 find abs V Yc 1 1 gt 0 amp abs V Yc 1 1 lt 0 001 vy 1 2 find abs V Yc 1 nyc gt 0 amp abs V Yc 1 nyc lt 0 001 vy 2 1 find abs V Yc 2 1 gt 0 abs V Yc 2 1 lt 0 001 vy 2 2 find abs V Yc 2 nyc gt 0 amp abs V Yc 2 nyc lt 0 001 vy 3 1 find abs V Yc 3 1 gt 0 abs V Yc 3 1 lt 0 001 137 Appendix A Matlab Codes lt 0 001 find abs V Yc 3 nyc gt 0 amp abs V Yc 3 nyc lt vy 3 2 c o O dO o VI O a O a VIO m o eno A B P p Y NN NN tO ANO gt lt mH x wer g NONON 04 QAaAaAA iZ se se oo gt n e oc n dud Q o eno o eno oe o eno Ro Ae e R n Gd es ANO gt Q QN QN QN QN OQ QN QN QN QN QN QN QN Se Fe teet cm DOS SON We e Ne MO OA CONS NEN DA D D D ANO gt ANO gt ANO gt ANO sf O A A Bo TROR SAY Re nee e NS Haad ime C A cie l x x Xx X x x Xx X AA Du 54 D4 04 74 04 e B T iq N ei m LU gt gt gt gt gt gt gt gt gt gt gt gt gt gt gt gt HNM sf aU x x Xx X x x X X AA A 03 NANANA Se A m GaGa G G ES E G GaGa G GGG x XX X dG ot tol oi toll oi toll toi tol AAAA t st NANA NANA NANA NANA anaana eS Soi n oN Soy no OM Soy n OM Soni no SOM c ce e n
25. Y positions Serial 115200baud Serial 115200baud Figure 4 18 Block diagram for photo voltage acquisiton and position measurement system HBX H bridge for motor X HBY H bridge for motor Y MX motor X MY motor Y PWM1 pulse width modulated signal fed in to motor X PWM 2 pulse width modulated signal fed in to motor Y COMI communication port 1 COM2 communication port 2 CLK clock to synchronize photo voltage acquisition position measurement DIO digital input output channels PC personal computer 4 3 Experimental Study of the Position Detector 72 The experimental setup in Figure 4 17 can be divided into three main parts the optical setup and XY stage as shown in Figures 4 19 and 4 21 and the data acquisition system shown in Figure 4 18 The transmitter optics consists of a single mode optical fiber cable where one of its ends is connected to a He Ne laser source and the other end is coupled to a collimator The optical fiber cable acts as a spatial filter at a wavelength of 633 nm which removes higher modes so that only the fundamental mode is left A collimator F260FC B Thorlabs is used with a 633 nm alignment wavelength where the lens is manufactured to be one focal length away from the output end of the fiber The laser beam is then projected into a Galilean Beam Expander BE03M Thorlabs which is used to adjust the beam diameter to be the same size as one side of a photocell On the other hand the receiver optic
26. beam is scans the plane of photocell array Since optical power is directly related to the incident area of overlap between the photodetector and the beam P ib dA closed form equations for the area of intersection for one photodetector cell have been found for further analytical purposes Next we derive the equations for the optical power covered by the required area of overlap between the detector active surface and the beam spot given the beam s Gaussian intensity profile After evaluating the optical power as the beam is scanned over the active surface of one photodetector cell the theoretical optical acquisition system model is extended further to account for an array of four photodiodes with horizontal and vertical spatial gap separations The optical power for each photodiode is calculated as the beam moves about the plane covered by the quadcell 4 2 Theoretical Optical Acquisition Model 45 The laser beam incident onto a 1 cmx1 cm square photodetector cell is mod eled as a circular spot with a radius pp 0 5 cm We developed a code to compute the interception area between the circular beam spot and the photodetector as the beam center is moved anywhere outside and inside the boundaries of the square cell The position of the beam center is determined with respect to the origin of the Cartesian coordinate system located at the center of the photodetector To calculate the area through simulation certain supporting paramet
27. can be computed as follows Yk p bk 05171 p 0272 p GEN DN p 4 Next let us define the error x p as the difference between the actual desired output y p and the estimated output y p Ek p Yr p Ye p Ye p Dx ajazi p akoxa p Aen TN p 5 Equation 5 can be rewritten as follows Yr p bx Gert p axaxa p xn LN p Ex p 6 Let us assume that the input and the actual output are measured for 1 lt p lt N By substituting p n n 1 Np into equation 6 and combining the resulting equations into the vector matrix equation we obtain 1 WN Initialization 155 yi n 1 RC e A by ex n yx n 1 1 zy n 1 gy n 1 Oki y n 1 yk Np 1 x1 Np tN Np ON Ek Np In addition let us define yx n 1 ex n 1 aki Y Np Ex Np Ux Np Yk Np Ex Np QkN and 1 mln zy p 1 zi n 1 gyn p 1 C Np 1 x1 Np Tn Np Therefore the vector matrix equation can be written as follows Y Np C Np U Np Ex Np 7 1 WN Initialization 156 Let us define the performance index as Eto EN Np Ex Np 8 Thus our problem becomes that of determining Up Np such that the param eter values bp 4x1 4x2 gn Will best fit the observed data Let Jm SEE Np Es Np Ye Np C Np Us Np Ve Np C Np Us No 5 YE
28. cos 7 2 sino sin 1 2 sing 4 12 sin 6 7 2 sing cos 1 2 cos sin 7 2 cos 9 4 13 Substituting equations 4 10 to 4 13 into equation 4 9 we get the following 2 2 39 Jis po E alih amp po sin o E o1 sin Y 2 12 2 sino cos po E zm 6 po sin a cos o5 4 2 12 2 sin a cos Q 2 _ po m ay sina B E ay 10 SER cos a1 e Therefore A can be stated as 2 fr sina A o a cos a 0 4 14 2 2 cos 4 2 Theoretical Optical Acquisition Model 52 Similarly area A is evaluated as follows B2 po A f mo T py Ba B 27 Po P agen 5 ena fo p d Ba 2 A B 95 1 f y wo 2 sin 8 2 po sin B T Q T B Ba 2 2 2 Po sin b Po po sin Bi 1 EL d 2 sin 8 2 62 Tr e 2 sin T Q T Q 2 205 2 _ fo po sin B1 Ba loa LE cot gl po TE po sin B cos 8 NE 2 sinf p 2 205 2 PO po sin fi cos cos m 10 4 1 2 p 2 sin sin r 4 m where cos Bz cos T 1 cos ff 4 16 sin 62 sin 7 81 sin f 4 17 cos T cos 7 cos sin 7 sin cos 4 18 sin 7 sin T cos cos z sing sin 4 19 Substituting equations 4 16 to 4 19 into equation 4 15 we get the following _ po posi cos cose i y 9 Fal 2 E p posin B sin 6 81 2 sin 3 sin 2 l6 al 2 A
29. nxV length V nyV nxV vx 1 1 find abs V Xc 1 1 gt 0 amp abs V Xc 1 1 lt 0 001 vx 1 2 find abs V Xc 1 nxc gt 0 amp abs V Xc 1 nxc 0 001 vx 2 1 find abs V Xc 2 1 gt 0 amp abs V Xc 2 1 lt 0 001 vx 2 2 find abs V Xc 2 nxc gt 0 amp abs V Xc 2 nxc lt 0 001 vx 3 1 find abs V Xc 3 1 gt 0 amp abs V Xc 3 1 lt 0 001 vx 3 2 find abs V Xc 3 nxc gt 0 amp abs V Xc 3 nxc lt 0 001 vx 4 1 find abs V Xc 4 1 gt 0 amp abs V Xc 4 1 lt 0 001 vx 4 2 find abs V Xc 4 nxc gt 0 abs V Xc 4 nxc lt 0 001 vy 1 1 find abs V Yc 1 1 gt 0 amp abs V Yc 1 1 lt 0 001 vy 1 2 find abs V Yc 1 nyc gt 0 amp abs V Yc 1 nyc lt 0 001 vy 2 1 find abs V Yc 2 1 gt 0 amp abs V Yc 2 1 lt 0 001 vy 2 2 find abs V Yc 2 nyc gt 0 amp abs V Yc 2 nyc lt 0 001 2 2 JP o o9 o o oe oe o 2 2 Bs qu B p 135 Appendix A Matlab Codes Y dq c o O O do do o VI o vi oO AN C we C O Si RR vI O VIO 3 v ae NN NN 0 ast dno si mo tO Du 04 D4 04 5 54 ana A g g oe oe gt gt TE T2 e oc DE m ud 20 20 dam st Q Q ars TEE MOS rSf MOS rS rS Se A n 0 no Ri ee PS AS ERE PEDE DEN EN Sy by Dy DY Q 2 CN ON ON ON CN ON QN ON C
30. oo oo oo oo oo oe oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oe oo oo oo oo oo oo oo oo oo oo oe oo oo oo oo oo oo oo oo oo oo oe oo oo oo oo oo oo oo op oo oe o oe oe o oe oe o oe oe o o o N A fy S uo E OT p qo 3 fx O S oO A amp LEN H e E Dz n x O Oo bp a 24 n m 3 1 gt O Q S nm i S eB 0 S P oo x af A y Y uy ae oe oe oe o o9 oe oe o o oe oe oe oo oe oo oe oo oo oo oo oo oo oo oo oe oo oo oo oo oo oo oo oo op oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oe oo oo oo o oo o oo oo op oo oo oo oe oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oe oo oo oo oo oo oo oo oo oe oo oo oo oo oe oo oo oo oo oo oo oo oe oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oe oo oo oo oo oo oo ele clear all x coordinate of beam spot centre Sy coordiate of beam spot centre Fr 2 2 0 01 0 01 2 2 XC yc Zz f T v v X m aa Bop O 5 aq 0o O nar orm 0 01 olddiv Specify resolution for the x position 20 05 0 02 newdivx newdivy Specify resolution for the y position r r gt gt sef eed OO 33 O O i TRS X D gt gt ocn D D z o o ID
31. unsigned short baudRate El SCI1_InStatus Checks if new input is ready TRUE if new input is ready Input none Output TRUE if a call to InChar will return right away with data id FALSE if a call to InChar will wait for input extern char SCI1_InStatus void ra SCI1_InChar Wait for new serial port input busy waiting synchronization Appendix D Microcontroller Code 206 Input none Output ASCII code for key typed extern char SCI1_InChar void Reads in a String of max length extern void SCIl_InString char x unsigned short SCI1 InUDec InUDec accepts ASCII input in unsigned decimal format EE and converts to a 16 bit unsigned number valid range is 0 to 65535 Input none Output 16 bit unsigned number If you enter a number above 65535 it will truncate without an error Backspace will remove last digit typed extern unsigned short SCI1_InUDec void SCI1_InULDec InUDec accepts ASCII input in unsigned decimal format Pi and converts to a 32 bit unsigned number Lif valid range is 0 to 4294967296 Input none Output 32 bit unsigned number If you enter a number above 4294967296 it will truncate without an error Backspace will remove last digit typed extern unsigned long SCI1_InULDec void SCI1 InSDec InSDec accepts ASCII input in signed decimal format and converts to a 16 bit
32. x0 amp xn 0 a Ri amp eo amp xn gt 0 yn lt yo amp xn xo amp xn lt 0 Ay 2 pi due cary eM B povera c 1 amp length xint if dxz0 amp B Axy 2 pi 2 alpha beta PE M cos phi cos phit alpha sin beta sin phi sin phi beta Area Ay Axy elseif aa i pm Axy 2 pi 2 alpha 1 2 xsin 2 xalpha Area ice elseif ir amp e Axy 2 pi 2 beta 1 2 xsin 2 xbeta Area Eu elseif dx 0 amp dy Area p1 4 x 172 end elseif length c 0 length xint Area Ay end oe oe Coordinates of the center of the circle xn yn are located in Region 13 14 15 or 16 elseif xn xo amp xn gt 0 amp yn lt yo amp yn 0 xn xo amp xn 0 amp yn lt yo amp yn gt 0 xn xo amp xn gt 0 amp yn yo amp yn 0 xn xo amp xn 0 amp yn yo amp yn 0 oe oe Appendix A Matlab Codes 123 end end end if length c 1 amp length xint 2 Ay r 2 2 pi 2 beta sin 2 beta Ax r 2 2 pi 2 alpha sin 2 alpha Axy r 2 2 pi 2 alpha beta sin alpha cos phi cos phitalpha sin beta sin phi sin phi beta Area Ac AytAx AXy elseif length c 0 length xint Ay r 2 2 x pi 2xbeta sin 2 beta Ax r 2 2 x pi 2xalpha sin 2xalpha Area Ac AytAx end Appendix A Matlab Codes
33. xd x1 Case Upper and lower part of circle intersect xl Sat the same point elseif length jyl 2 yatxl 1 yatx1 2 jyl jyl1 1 yc yatx1 jy1 Case Circle intersects x1 at one and only one point elseif length jy1l yc yatx1 jy1 Case No intersetion between circle and xl elseif length jyl 0 yc i yc i end Case Circle intersects x2 at two different points if length jy2 2 yatx2 1 zyatx2 2 yc yatx2 1 yd yatx2 2 XC X2 xd x2 Case Upper and lower part of circle intersect x2 sat the same point elseif length jy2 2 yatx2 1 yatx2 2 jy2 3y2 1 yd yatx2 jy2 Case Circle intersects x2 at one and only one point elseif length jy2 yd yatx2 jy2 Case No intersetion between circle and xl elseif length jy2 0 yd i yd i end CK CKCk ck kCckck ckckck ck ck ck ck kck ck ck ck ck ck ckck kck ck ck k ck ck ck k ck kk k kk kk x y coordinates of intersection points KKEKKKKKKKKKKKKKKKKKEKKKKKKKKKKKKKKKKKKKKK o oe oe oe oe o o oe xint xa xb xc xd yint ya yb yc yd A xint yint p isreal A if p m n find A i if length n No intersection B i i i il xint B 1 yint B 2 Appendix A Matlab Codes 113 elseif length n 3 points of intersection if abs B 1 B 2 x1 0e 015 abs B 1 B 2 gt 0 C B 1 B 3 1 xint C 1 yintsc 2 2 elseif a
34. 0 35 P4 Experimental data PAWN test output 92 4 n 0 25 so s 0 2 N s 0 15 T Ne 0 1 N Nx 0 05 S 0 umm oe m a 0 5 0 0 5 y cm Figure 5 19 Comparing the WN test output and the experimental data for vertical scanning at x 0 cm The resolution for the x data used in the training is 0 1 cm and the resolution for the y data used in the training is 0 02 cm 5 2 Training and Testing of Wavelet Network 96 8 MSE il 6 MSE train test MSE 10 10 10 10 No of Wavelons N Figure 5 20 Comparing the MSE values vs N after training the theoretical model with gaps and after testing for the theoretical data set at z 0 cm The resolution for the x data used in the training is 0 05 cm and the resolution for the y data used in the training is 0 02 cm 0 4 T T T T T T T Theoretical model O WNtestoutput 4 0 3 0 2 0 17 0 4 1 fi fi 1 1 fi fi 0 4 0 3 0 2 0 1 0 0 1 0 2 03 04 Figure 5 21 Comparing the WN test output and the theoretical model with gaps for vertical scanning at x 0 cm The resolution for the z data used in the training is 0 05 cm and the resolution for the y data used in the training is 0 02 cm 5 2 Training and Testing of Wavelet Network 97 Theoretical model O WN test output 0 4 0 4 0 3 0 3 0 2 0 2 0 1 0 1 x gt
35. 1 DW VA Wo l 1 37 where Ab 1 Aa41 1 Aii 1 ainN 1 Abo 1 Aas1 1 Aa 1 Aaon 1 AN Ts 38 Aby 1 Aan 1 Aan i 1 Aay n 1 Using DeltaWoi AW l and Delt aWoi_old AW l 1 equation 37 can be computed as follows DeltaWoi DWoi_aver gamma DeltaWoi_old The parameters of W are then updated as follows Woi WoitDeltaWoi Then for the next epoch we have DeltaWoi_old DeltaWoi 3 Backpropagation Algorithm 178 3 2 Updating the parameters of Won Let us state the following equations for Acx l OJ Ac I VA a TyAo 1 1 p OCkj n ad ow ee cen ee y AA J amp Pao ento 0 1 Since equation 39 can be rewritten as Np 1 Acz l a gt etu yAcy l 1 41 p p 1 Let DWoh DW be a 3D array with N pages where each page constitutes of the following matrix dej dc dey dein dez de dey den DW 42 dej dCi dej dej y dex dew den CNN Next let us define the page vector DWoh k j Dcp as stated below Dg dc dci a der dc E id 43 j The components of Dcp are computed as follows 3 Backpropagation Algorithm 179 for k 1 No for j 1 Nw DWoh k j E k xu PHI 3 end end Let N 1 p d mean Dey m gt etu 44 p p 1 Next define the matrix DWoi aver DW as follows deii dera d d w dCi dC35 rome
36. 1 s elseif F 1 1 0 m i s end Using such a dyadic grid the dilation parameters should not be zero however just for consistency we apply the same if statements as the code above if G 1 1 d i 9 G l 1 t elseif G 1 1 420 1 WN Initialization 166 end The i of the main for loop is then incremented and the preceding procedure is repeated until i Ni The end result of the initial values for the matrices m m and d d is as follows gt gt m m 0 0 0 0 0 5000 0 5000 0 5000 0 5000 0 5000 0 5000 0 5000 0 5000 0 7500 0 7500 0 7500 0 7500 0 2500 0 2500 0 2500 0 2500 0 2500 0 2500 0 2500 0 2500 0 7500 0 7500 0 7500 0 7500 gt q d 1 0000 1 0000 1 0000 1 0000 0 5000 0 5000 0 5000 0 5000 0 5000 0 5000 0 5000 0 5000 0 2500 0 2500 0 2500 0 2500 0 2500 0 2500 0 2500 0 2500 0 2500 0 2500 0 2500 0 2500 0 2500 0 2500 0 2500 0 2500 2 Feedforward Algorithm 167 where Mii Mia c Mi ccc MIN 1121 Masa scc Ma M N Tm T2 Mji MIN MNwl MN 2 ccc MN t MN N and dii dig s du ce din doi do de c don d 14 di dj dji diN dy dn 2 ES dN i jas ANN The algorithm described for dyadic initialization of the translation and diala tion parameters is not necessarily general However to ensure that it works for different ranges it is recommended to have equal absolute values for ak and bk if the range extends to the negative scale In addition it is als
37. 1 1 E k Ddy k 5 EDmy EDmy eDmy EDdy EDdy eDdy Appendix A Matlab Codes 142 end Dm 3 1 EDmy Da 3 1 EDdy end end for k 1 No for j 1 Nw DWoh aver k j mean DWoh k 3 end end for k 1 No for i 1 Ni 1 DWoi_aver k 1 mean DWoi k i end end for 3 1 Nw for i 1 Ni Dm_aver j i mean Dm 3 1i Dd_aver j 1 mean Dd j i end end DeltaWoi DWoi averd DeltaWoh DWoh_avery Deltam Dm_aver gammaxDeltam_old Deltad Dd_aver gammaxDeltad_old SUpdating Woi Woh m andd Woi Woi Del Woh Woh Del m m Deltam d d Deltad Del taWoi ol taWoi taWoh d DeltaWoi DeltaWoh_ol Deltam_old d DeltaWoh Deltam Del tad_old Deltad end figure 1 loglog MSE x xlabel Iterations ylabel MSE grid on Save NK X O to Y 2 x 3 2d tgamma xDeltaWoi_old tgammaxDeltaWoh_old RP Simulated data no gaps w gaussian N1 5 Nw 31 gamma 0_99 u 0_01 loops 10to5 testing_0 divx 0_05 divy 0_05 figure 2 lot3 Y hat 1 Y hat 2 x 1 old on lot3 Y 1 abel x abe abe Appendix A Matlab Codes 143 igure 3 lot3 Y hat 1 Y hat 2 x 2 old on lot3 Y l i Y 2 x 2 ET abel x abel y abel P2 NK XC O 2 O Hh igure 4 lot3 Y_hat 1 Y
38. 124 SESCSSEEEEEEEEES ESE SSS SESE EEEEEEEEEEE SESE SSC SEEEEEEEEEEES ESS SSSSSS SESCS SEC EEEEEEEE SESE SSS SEC ESEEEEEEEEEE ESS SES SESEEEEEEEEESESSESSSSSSESS 55 Function to calculate the Power at the area of overlap 55 55 between circular beam spot and the square photocell 55 Center of circular beam spot is moving along the x axis SSS while the square photocell is fixed at the origin SSS 55 of the coordinate system 55 55 Given diameter of the circular beam spot is equivalent SSS 55 to one side of the square photocell 55 55 filename POWERX2 m 55 55 525 Written by Yasmine El Ashi Fall 2007 SSS SESSSSCCEEEEEEEES ESS SSS SES EEEEEEEEEEE ESE SES SESEEEEEEEEESESESSESSSSSS SsSSSSSSSSSSSSSSSSo00000005050000000000000000000000000000000 Sk kk ke ke coke ok ok ck ck ck ck ck kk ke ke check ck ck ck ck ck ck ck kk check ck cock ck ck ck ck ck ck RRR KK KKK KK KK KS x Input to the function x Sx r radius of circular beam spot Sx xn x coordinate of the center of the beam spot Sx yn y coordinate of the center of the beam spot Sx xint x coordinates of the intersection points between Sx the circular beam spot and the square photocell Sx yint y coordinates of the intersection points between Sx the circular beam spot and the square photocell x Sx xO x coordinate of the right side of the square Sx photocell Sx yo y coord
39. 2 B xint C 1 C B 5 1 B t 2 yint C 2 elseif abs B 1 B 3 lt 1 0e 015 abs B 1 B C B 1 B 2 1 xint C 1 yint C 2 end elseif length n 2 2 points of intersection if n 1 1 n 2 B A 3 A 4 15 elseif n 1 1 amp n 2 3 B A 2 A 4 15 elseif n 1 1 amp n 2 4 B A 2 A 3 elseif n 1 2 amp n 2 3 B A 1 A 4 elseif n 1 2 amp n 2 4 B A 1 A 3 elseif n 1 3 amp n 2 4 B A 1 A 2 Appendix A Matlab Codes 109 end end SPlot of area vs end if B 1 B 2 C B 1 xint C 1 yint C 2 else end elseif length n 1 point of intersection f 10 sum n B A xint B 1 yint B 2 end 2 points of intersection special case half area of circle inside square elseif p40 amp sum sum A B A 1 A 2 xint B 1 yint B 2 elseif ps0 xint A 1 yint A 2 end oo Distance betwee 1 sqrt x1 xn Distance betwee 2 sqrt x2 xn Distance betwee 3 sqrt x2 xn Distance betwee D 4 sqrt x1 xn El oo O oo E oo c find D r Xn xn s Yn yn t 4 points of intersection n cornerl xo yo and centre of circle s 2 y1 yn t 2 n corner2 xo yo and centre of circle s 2 y1 yn t 2 n corner3 xo
40. 2006 In addition she completed a minor in Applied and Computational Mathematics She enrolled in the Mechatronics Masters program in the American University of Sharjah as a graduate assistant in 2007 Furthermore she worked on a project funded by AUS Research Grant on Modeling and Analysis of a Wavelet Network Based Optical Sensor for Vibration Monitoring Published conference papers e Y El Ashi R Dhaouadi and T Landolsi Design of a Novel Optical Vibrometer Using Gaussian Beam Analysis Proc of 5th International Symposium on Mechatronics and its Applications ISMA08 Amman Jordan May 2008 e Y El Ashi R Dhaouadi and T Landolsi Accuracy of a Gaussian Beam Optical Vibrometer with a Quad Photodetector Spatial Separation Proc of 3rd International Conf on Modeling Simulation and Applied Optimization Sharjah UAE January 2009 Published journal paper e Y El Ashi R Dhaouadi and T Landolsi Position Detection and Vibration Monitoring System Using Quad cell Optical Beam Power Distribution Journal of the Franklin Institute April 2010 Submitted journal paper e Y El Ashi R Dhaouadi and T Landolsi Modeling and Analysis of a Wavelet Network Based Optical Sensor for Vibration Monitoring IEEE Transactions on Sensors April 2010
41. 3 4 Wavelet Networks WN 42 The components of the vector 097 00 for the conventional WN can be derived as follows qe Onk 3 14 ze nk 3 15 x 75d 3 16 x Chi ai 3 17 aye 8T Az PN Adj HO Ody Here Zi x Mji djis for i l SUE Ni j 1 tain No k 1 ie No and p 1 N Notice that we used Kronecker s symbol delta defined as ng 1 for n k and ng 0 for n k The network parameter vector 0 is updated every epoch by using new boia A0 D where Ad l es FyA0 i 1 3 19 Here u is the learning rate and y 1 u is the momentum coefficient where both are set in the interval 0 1 The figure of merit used to assess the approximation results is the mean squared error MSE which can be stated as follows Np No 1 ds un 2 x E pl 2 MSE 5 gt yu 9D y 0 3 20 p 1 k 1 Optical System Modeling and Design 4 1 SYSTEM ARCHITECTURE The hardware architecture of our system as shown in Figure 4 1 consists of a laser source mounted on two actuators for azimuthal and vertical motion steering The laser source is adjusted to point at a mirror placed on a vibrating platform The Gaussian beam emitted from the source is reflected by the mirror onto a photodetector array which captures the light intensity distribution of the laser spot Different photocurrent outputs generated from each photodiode PD depend on the relat
42. 95 Normalized Power Normalized Power P1 Experimental data A 0 8 A P1 WN test output Y y A 0 6 A As 0 4 Pod e 0 2 5 0 0 5 0 0 5 y cm 1 P3 Experimental data 0 8 LH P3WN test output 0 6 0 4 0 2 Normalized Power Normalized Power 0 8 0 6 7 P2 Experimental data O P2WN test output 4 P4 Experimental data 0 8 s x s PAWN test output j de A 0 6 v M 0 4 x E amp 0 2 lc et pe 0 5 0 0 5 y cm Figure 5 18 Comparing the WN test output and the experimental data for vertical scanning at x 0 55 cm The resolution for the z data used in the training is 0 1 cm and the resolution for the y data used in the training is 0 02 cm Normalized Power Normalized Power 0 35 P1 Experimental data 03 A P1WN test output 0 25 Pd 0 2 EA A e 0 15 A A Ad 0 1 Ar 0 05 aE 1 4 1 olm t 0 5 0 0 5 y cm 0 35 P3 Experimental data O P3 WN test output 0 3 a 0 25 A Na B 0 2 p s 0 15 S c 0 1 EN g su 0 05 E 0 Timme a 0 5 0 0 5 y cm Normalized Power Normalized Power 0 35 P2 Experimental data 0 3 O P2 WN test output 0 25 e Ld 4 0 2 o O e o 4 0 15 o 4 o oe 0 1 Or 005 o rA PA 0 Lm qa ER 0 5 0 0 5 y cm
43. E eu SP exp jkz U r AG it p jkz At 1 f i J 2 exp jkz an rar v C Ai em jk Ap ew Cil lq 2 exp j arg q z 2R z 27W 2 l Since k we have KA 1 and the above expression can be written as M exp Jj ar z p ex T um exp jkz ike U 2 exw Coni fa evo o exp ake 2 n 2 3 Wavefronts 25 Substituting the expression for q z and arg q z 5 C 2 into equation 2 51 then multiplying and dividing by Wo we have the following G ga T Cas m Co i TO s 75 exp ie E AM t jc e Therefore the expression for the complex amplitude U r of the Gaussian beam can be stated as E s Ao eb 25 es ie kf 4 jc e 2 52 A new constant Ag A j2 has been defined for convenience In addition the beam parameters can be stated as follows 1 2 ls 2 2 53 20 R z 2 Ey l 2 54 W z Wo C z tan 3 2 55 Wo 5 2 56 T Equations 2 52 2 56 will be further used to determine the intensity and power properties of the Gaussian beam 2 3 Wavefronts 26 2 3 9 1 Intensity The optical intensity J r U r is a function of the axial and radial distances z and p 2 4 losak hs pm E 2 57 where Ip Ao At each value of z the intensity is a Gaussian function of the radial distance p Due to this the wave is called a Gaussian beam The Gaussian function has its peak
44. La 0 5 2 Sa Ga Ya 0 5 6 2 The main objective of the optical acquisition model is to obtain the optical power distribution generated at each photodetector while the beam is scanned throughout the entire quadcell plane thus an algorithm has been developed to calculate the optical power for each cell The minimum resolution that can be generated using our algorithm is 0 01 cm for both the x and y positions The mathematical model mentioned in the previous discussion has been ob tained while considering the origin of the x y coordinate system situated at the center of one photocell Therefore to evaluate the optical power for the quad cell using equations 4 29 4 34 and 4 41 the origin of the absolute 4 2 Theoretical Optical Acquisition Model 65 coordinate system will be translated by a certain vector determined by the coordinates of the center of the cell The portion of power captured by each cell is calculated To find the power distribution for cell 1 in the array the translational operation x y 1 y1 is first made Then the earlier power calculations are carried out on photocell 1 A similar translation is applied to the second third and fourth cell where the power distribution is evalu ated for each cell separately Figures 4 9 to 4 12 show the normalized power distributions for each photocell assuming e and 6 to be negligible lt gt SURE Ede NEE RR Figur
45. O O 9 o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o O 9 9 0 0 9 O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o 2 2 o o e o o o o oe oe 2 o 2 ele clear all for k 1 10 epsn 0 1x k 1 SEpsilon horizontal gap dlta 0 1x k 1 Delta vertical gap xs1 0 5 epsn 2 ys1 0 5 dlta 2 5 Centre of photocell xs2 0 5 epsn 2 ys2 0 5 dlta 2 Centre of photocell xs3 0 5 epsn 2 ys3 0 5 d1ta 2 Centre of photocell xs4 0 5 epsn 2 ys4 0 5 d1ta 2 Centre of photocell xc 2 0 01 2 yo 2 0 01 2 x coordinate of y coordinate of the beam spot center the beam spot center nxc length xc nyc length yc Xc 1 7xc xs1 Yc 1 yc ys1 Xc 2 7xc xs2 Yc 2 yc ys2 Xe 3 xc xs3 YC 3 yc ys3 Xc 4 xc xs4 Yc 4 yc ys4 load Pcentre Normalized power for one photocell 3 0 01 3 SRange for the x and y plane for Pcentre
46. Quad Cell as Position Sensitive Detector IEEE Sensors Journal vol 10 no 2 pp 286 293 Feb 2010 B E A Saleh Fundamentals of photonics New York Wiley 1991 G Laufer Introduction to optics and lasers in engineering Cambridge New York Cambridge University Press 1996 D A McQuarrie Mathematical methods for scientists and engineers Sausalito California University Science Books 2003 T Poggio and F Girosi Networks for Approximation and Learning in Proc IEEE vol 78 no 9 Sept 1990 I Daubechies Ten Lectures on Wavelets Philadelphia CBMS NSF re gional conference series in applied mathematics 61 1992 S Mallat A Wavelet Tour of Signal Processing San Diego Academic Press 1998 E S Garcia Trevino V Alarcon Aquino and J F Ramirez Cruz Im proving Wavelet Networks Performance with a New Correlation based Ini tialisation Method and Training Algorithm in Proc 15th International Conf on Computing IEEE 2006 Q Zhang Using Wavelet Network in Nonparametric Estimation IEEE Transactions on Neural Networks vol 8 no 2 pp 227 229 July 1996 I Daubechies The Wavelet Transform Time frequency Localization and Signal Analysis IEEE Trans Information Theory vol 36 no 5 Sept 1990 S G Mallat A Theory for Multiresolution Signal Decomposition The Wavelet Representation IEEE Transactions of Pattern Analysis and Ma chine Intelligence vol 2 no 7
47. Root Mean Square value for the output voltage of a photocell in darkness is about 4 63e 004 V To avoid the effect of ambient light on the photocells output voltage as shown in Figure 4 23 the experiment is conducted in a dark room Under ambient light conditions the photodiodes readings should be adjusted to account for additional induced photocurrent Five different runs were car 4 3 Experimental Study of the Position Detector T9 ried out by scanning the beam spot along the y axis of the quadcell plane while fixing the x position of the beam center at 1 05 cm 0 55 cm 0 cm 0 55 cm and 1 05 cm By referring to Figure 4 8 and given that e 0 1 cm the beam spot was first scanned vertically along the left sides of photocells 2 and 3 where the x position of the beam center is 1 05 cm The second scan was made along the vertical axis passing through the centers S2 and S3 of photocells 2 and 3 where x 0 55 cm Furthermore a vertical scan at x 0 cm along the y axis of the array plane was carried out The last two runs were made along the vertical line x 0 55 cm passing through the centers 54 and 4 and along x 1 05 cm passing through the right sides of photocells 1 and 4 The output photo voltage is directly proportional to the optical power sensed by a photocell The output voltage is derived as Vo E APR Ra Rs gt 4 42 where A is the amplification gain Pop is the incident optical power and Ra
48. U U HNM sf HNM Y HNM sf HNM sf PCR DC Exi x Xx X X x x X X D 3 D3 03 Dad 9 A 04 See et Sat Se d UO O0 O0 0 aA ALA UO OO 0 amd x x x Xx gt gt Mohr Sc vv Rer MR o e eno en aoa A nn Ld d IO t 4 I to tod t 4 0000 Qa Q ppc anaana 94454 d o e c Vc orbe o c n loeo eX cl bpp yp s nud AR E rd rc EE wo ni c ua CTT dams dams dno ss dams 0000 H H x x Xx X x x X X AA Du 54 D4 3 3 04 A A AY AY H uj gt PP Pp TTT DU gt PP Pp O 70 O TU lo dg dw g oll iow o IA log dog lo dg Wo lo dg oo nananana 1 CN ade added Lue eel xL eh St MON N SPOSD e C0 sr oN 05 sr e OC 05 sr oN 05 sr Sn ee EET E MESA E eee E DA as es Quo SR A Renae Pete Tee HNM gt A x x X X x x X X Da DS Da D Da D Da 54 NNN WN gt gt C S OO A ALAA DUDO AAAA aoama psl k p PS1 201 201 end end 0 0 1 0 9 dlta 0 0 1 0 9 epsn vs 0 0 2D Plot of normalized power of photocell 1 at LO H N 0 ts z o O zz Aa A O amp n IJ ams TRI pn DEO H A U N a Hog dH A G O Oo p poor dg Oo sg d d amp O do NH H zz Q00 a o B cC 5 aun Q Q OF Co 10 E non ej Aa Hw od YO NH ON Q QQ Q 4 r d OOO E 3 O M oo Q O GO X WN Appendix A Matlab Codes 138 o oe oe oe o oe oe oe o oe oe oe o oe o oe o oe o9 oe o oe oe oe o oe o oe oe oe o oe oe oe o oe o oe oe oe o oe o oe o oe o oe o oe oe oe o oe o
49. a beam spot of radius 1 5W z where W z is the beam waist at the photodetector plane These parameters are not necessarily guaranteed in the experiment Practically the beam radius was adjusted manually by gradually increasing it using the beam expander until the beam spot fits into the active area of one 4 3 Experimental Study of the Position Detector 80 Initial position gt a iia rey Sipe eye ethene Figure 4 29 Uncertainity region when initializing the position of the beam center photocell The radius of the beam spot will be 0 5 cm Ap cm where less than 99 of the optical power is contained thus causing a reduction in the optical power obtained in the experiment and that found theoretically In addition the other source of error between the theoretical and practical results in terms of the shift in the y position and the difference in optical powers is due to having e 0 1 cm Ae cm and 0 3 cm A cm The errors Ae cm and A cm are added distances due to the thickness of the ceramic wafer surrounding the Si detector and the fact that the active area for FDS1010 is about 9 7 mmx9 7 mm which is less than the assumed theoretical active area of 1 cmx1 cm Since the quad cell detector is placed on a metallic plate there will be inevitable optical diffraction and reflections which cause a difference between the theoretical and measured power especially along the scan at r 0 c
50. be relatively very small we finally obtain the following Paraxial Helmholtz equation VZA ajel 0 2 46 where V2 0 0z 0 y is the transverse Laplacian operator An important solution of the Paraxial Helmholtz equation that exhibits the characteristics of an optical beam is a wave known as the Gaussian beam In principle the beam power is concentrated within a small cylinder surrounding the beam axis The intensity distribution in any transverse plane is a circularly symmetric Gaussian function cen tered about the beam axis The width of this function is minimum at the beam waist and grows gradually in both directions In the next discussion an expression for the complex amplitude of the Gaussian beam is derived as well as a description of its physical properties such as intensity power and beam radius will be provided 13 2 3 Wavefronts 23 2 3 8 The Gaussian Beam One simple solution to the paraxial Helmholtz equation provides the paraboloidal wave for which Aj m A r jk 2 47 0 Lew 2 2 47 where p z y and A is a constant The paraboloidal wave is the paraxial approximation of the spherical wave U r A r exp jkr when x and y are much smaller than z Another solution of the paraxial Helmholtz equation provides the Gaussian beam It is obtained from the paraboloidal wave by use of a simple transformation Since the complex envelope of the paraboloidal wave is a solution of the
51. ck ck ck ke ck ke RR koc ck KA KARA RAR RA KA KA RARA RRA KA KA RARA KARA function Power POWERXY2 r xn yn xint yint xo yo c lamda 6 33e 05 Wavelength of a He Ne laser source in cm Spot size of the beam 2Wo 2 3cm to get 99 of Total Power Wo 1 3 zo pixWo 2 1amda SRayleigh range in cm z 0 SAxial distance z in cm Io 1 Maximum intensity value W Wox sqrt 1 z zo 2 Beam Width Il Iox Wo W 2 AA 11x W 2 72 BB exp 2 r 2 W 2 Pc I1x 2 xpi W 2 2 1 BB Power of spot with radius r Check if there is intersection x coordinate Check if there is intersection y coordinate px isreal xint py isreal yint se se Case 1 No intersection between circle and square OR just touching if px 0 amp py 0 length xint 1 Power 0 Appendix A Matlab Codes 129 elseif px40 amp pyx0 Case 2 Center of circle at the origin of the coordinate system if xn 0 amp yn Power Pc Case 3 Center of circle m elseif xn 0 amp ynz0 Power feval POWERY2 Case 4 Center of circle m elseif xnz0 amp yn Power feval POWERX2 Case 5 Center of circle m elseif xn40 amp ynzO0 if xn gt xo amp yn gt yo dx xn xo dy yn yo elseif xn xo amp yn yo dx xn xo dy yn yo elseif xn xo amp yn yo dx xn xo dy yn yo elseif xn gt xo amp yn yo dx xn xo dy yn yo elseif xn xo amp yn lt
52. ck ck k kc ck kk k kk kk Evaluating xa and xb ya and yb KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK KK oe oe oe oe oe o oe oe Case Circle intersects yl at two different points if length 3x1 2 amp xatyl 1 zxatyl 2 xa xatyl 1 xb xatyl 2 ya yl yb yl Case Upper and lower part of circle intersect yl at the same point elseif length jx1 2 2 amp xatyl 1 xatyl 2 jx1 3x1 1 xa xatyl 3x1 Case Circle intersects yl at one and only one point elseif length 3x1 xa xatyl 3x1 Case No intersetion between circle and yl elseif length 3x1 0 amp xa 1 xa i end Case Circle intersects y2 at two different points if length 3x2 2 amp xaty2 1 zxaty2 2 xa xaty2 1 xb xaty2 2 ya y2 yb y2 Case Upper and lower part of circle intersect y2 at the same point elseif length jx2 2 xaty2 1 xaty2 2 jx2 jx2 1 xb xaty2 jx2 Case Circle intersects y2 at one and only one point elseif length jx2 2 xb xaty2 jx2 Case No intersetion between circle and y2 elseif length 3x2 0 xb i xb i end Appendix A Matlab Codes 112 KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Evaluating xc and xd yc and yd CA Ck ckCck ck ck ck ck ck ck ck ckckockckck ckck ck ckckck ck ck ck ck k ck ck kk kk oe oe oe oe oe o Ae oe Case Circle intersects xl at two different points if length jyl 2 yatxl 1 zyatxl 2 yc yatxl 1 yd yatxl1 2 xc x1
53. d 2 E zs exp y TERY TS o Ww 27 E T 2 B To u 5 ew ipo doe f exp Css S 9 3 ort ki Ka a o 5 f exp x3 da 6 3 Therefore P can be stated as follows ag P k1Ka a2 o Ky f exp B o 8 Next P5 is evaluated as follows 82 po Py n I p 2 pdpdp Py B 2 T T ICI i T 2 _ 9 2 bt tom 4 39 Substituting equations 4 27 and 4 28 into equation 4 39 and taking the 4 2 Theoretical Optical Acquisition Model 61 limits v and v we have the following B2 v2 2 Po n f fe 5 dud TQ Ui Ba w 2 n f 5 coo conas mo B2 W 2 n f E Hepie exp cado mo ii W 2 2 y y fj 5 en g exp al dp n W 2 B2 9 Ba E EEN 2 n 7 exp gi dp ox ml iud d n o TQ B2 myl f ex 5 ao mo Therefore P can be stated as follows B2 Pr sh 0 1 f exp 5 o 4 40 T Substituting equations 4 38 and 4 40 into equation 4 36 Psy can be written in the following form a2 Py K1K9 E ay 61 TK J exp 73 da ore Ba LS exp 35 df 4 41 mo The integrals in the preceding equations were evaluated numerically Using equations 4 29 4 34 and 4 41 we developed an algorithm to determine the power P if the center of the circular beam spot is to be moved along any random path 4 2 Theoretical Optical Acquisition Model 62 Figure 4 7 Example o
54. dC mt dC3N DWon l l a 7 45 dCi dera dOg ce dCkn d n 1 d n 2 2 deni D dCy N The matrix DW is computed using the code for k 1 No for j 1 Nw DWoh aver k j mean DWoh k 3 end end In matrix form equation 41 can be stated as AWor 1 DWor T yAW on 1 1 46 3 Backpropagation Algorithm 180 where Aci 1 Aci 1 Aci 1 ACIN 1 Aco1 1 A C32 1 Aco 1 Acon 1 AWon 1 47 ACr1 1 ACh2 1 ACki 1 Ackn 1 ACy 1 1 Acn 2 1 Acn i 1 ACN N 1 Using DeltaWoh AW I and DeltaWoh_old Won l 1 equation 46 can be computed as follows DeltaWoh DWoh_aver gamma xDeltaWoh_old The parameters of Won are then updated as follows Woh Woh DeltaWoh Then for the next epoch we have DeltaWoh_old DeltaWoh 9 8 Updating the parameters of m and d Let us first state the following equations for Amy I and Ad 1 Am l a N Da N B Np No 2 5 p 1 k No 2 95 1 k p D 9j E oam n E A ramal 48 3 Backpropagation Algorithm 181 and u J Adj I Adj 1 1 Np No Ap H p Ok gt e yAd 1 1 Ny 2 2 23 Np N S 3 gt uel yAdj l 1 49 Since age 09 92 1 M Ge 4 599 A fe A 50 OM si Ck Oz OM si kj qe dji dji qa and Od 095 Oz 2 ro ae oe en 2 51 Od ji Ckj Oz Od ji kj It dji dji jiji
55. divx 0_05 divy 0_02 load RP simulated data gaps w gaussian N1 5 Nw 31 gamma 0_99 u 0_01 loops 10to05 testing_0 divx 0_05 divy 0_02 MSE_train 4 MSE end MSE_test 4 MSE_RPtest5 load MSE_test RP simulated data gaps w gaussian Nl1 6 Nw 63 gamma 0_99 u 0_01 loops 10to5 testing_0 divx 0_05 divy 0_02 load RP simulated data gaps w gaussian Nl1 6 Nw 63 gamma 0_99 u 0_01 loops 10to5 testing_0 divx 0_05 divy 0_02 MSE_train 5 MSE end MSE_test 5 MSE_RPtest6 load MSE_test RP simulated data gaps w gaussian Nl 7 Nw 127 gamma 0_99 u 0 01 loops 10to5 testing 0 divx 0 05 divy 0 02 load RP simulated data gaps w gaussian N1 7 Nw 127 gamma 0_99 u 0_01 loops 10to05 testing_0 divx 0_05 divy 0 _02 MSE_train 6 MSE end MSE test 6 MSE RPtest7 load MSE test RP simulated data gaps w gaussian N1 28 Nw 255 gamma 0 99 u 0_01 loops 10to05 testing_0 divx 0_05 divy 0_02 load RP simulated data gaps w gaussian N1 8 Nw 255 gamma 0_99 Appendix A Matlab Codes 147 u 0_01 loops 10to5 testing_0 divx 0_05 divy 0_02 MSE_train 7 MSE end MSE test 7 MSE_RPtest8 P P Nw 3 7 15 31 63 127 255 figure loglog Nw MSE train Nw MSE_ test o legend MSE_t_r_a_i_n MSE_t_e_s_t xlabel No of Wavelons Nw ylabel MSE i_trn_min find MSE_train min MSE_train Nw_min_MSE_train Nw i_trn_min
56. ee Kok ck kok ck kok ck kck ck kok ck ck ckckckckckock ck f include hidef h common defines and macros x include mc9s12dg256 h x derivative information define MAX 4 extern interrupt extern __interrupt extern __interrupt extern __interrupt Global variables void OV F ISR void void TIC2ISRX void void TIC2ISRY void void TICISR void float CounterX 0 CounterY 0 int countx1 0 countx2 0 county1l 0 county2 0 Initialization function void t2 Init connect emcoder to pt2 Channel 7 compare register is set to 0 TCRE bit is set so that free running counter ICT 0x0000 TSCR2 0x0A is set to 000 TIE 0x0E TSCR2 0x80 TCTL4 0x5C both edges for pin 1 TIOS 0x00 TSCR1 0x80 DDRB 0x00 pin 2 UP DWN 0 prescale of 4 Channel 1 2 3 TOI inhibited Captures on ri Channel 1 2 3 interrupt enabled and prescaler factor 1 sing edges only for pins 2 and 3 acts as input capture Timer is enabled and normal flag clearing setting PORTB for Y Interrupt subroutine pragma CODE SEG NON BANKED pragma TRAP PROC void TIC2ISRX 1 if PORTB 0x01 0x00 if countx1 0x00 countx1 0xff countx2 else countx1 I if PORTB amp 0x01 0x01 if countxl 0xff countx1 0x00 countx2 as input pin 0 UP DWN for X Appendix D Microcontr
57. emitted by a source and if uninterrupted can propagate indefinitely in both time and space Although there are certain media that can block radiation we find it more astonishing that electromagnetic waves can propagate through free space unlike electrical currents or sound conductors are not necessary for the transmission of radiation Although this property is unique to radiation some of its characteristics is analogous to the propaga tion of acoustical waves or vibrations in solids These waves like the electromagnetic waves combine propagation with the oscillation of a physical parameter Thus by analogy the description of the propagation of electromagnetic radiation should in volve equations similar to those describing the propagation of sound waves or the vibrational modes of solids Furthermore since we anticipate that electromagnetic 2 1 The Wave Equation 9 waves are the result of oscillatory motion of electric charges we should be able to derive equations describing their propagation from Maxwell s equations 14 First to demonstrate the analogy between electromagnetic waves propagation and that of acoustic waves we shall derive the wave equation for the case of just one spatial variable for the physical system represented by a vibrating string Consider a perfectly flexible homogeneous string stretched to a uniform tension r between two points Let u x t be the displacement of the string from its horizontal position
58. for the experimental setup showing different e cur CT Variation of the optical power detected by all four photodetectors as the beam is moved along y x line for different values of e and Plot of the normalized power for photocell 1 vs e when the beam center is at the origin of the quadcell plane e and are assumed to be egual 228 Sony Ret eG eke TV Plot of normalized power for photocell 1 vs e and when the beam centroid is at the origin of the quadcell plane Experimental prototype of the optical power acquisition system Block diagram for photo voltage acquisiton and position measurement system HBX H bridge for motor X HBY H bridge for motor Y MX motor X MY motor Y PWM1 pulse width modulated signal fed in to motor X PWM2 pulse width modulated signal fed in to motor Y COMI communication port 1 COM2 communication port 2 CLK clock to synchronize photo voltage acquisition position measurement DIO digital input output channels PC personal computer Optical setup of the system 2l a Transmission optics b Reception optics sss Signal conditioning circuitry for photodiode involving amplification and noise removal etos xke ROO Eo E we Ao CX E 3 Plot of photocell output voltage in darkness Plot of photocell output voltage in ambient light when no laser beam is APPS aa Sou d adeo a acie ue ARE ee Se a Plot of photocell output voltag
59. frames and wavelet networks as well as the wavelet network structure and learning procedure that will be adopted in our research 3 1 FUNCTION APPROXIMATION According to T Poggio in 16 the problem of learning a mapping between an input and an output space is similar to the problem of synthesizing an associative memory that retrieves the appropriate output when presented with the input and generalizes 3 1 Function Approximation 30 when presented with new inputs A classical framework for this problem is approx imation theory which deals with the problem of approximating or interpolating a continuous multivariate function f x by an approximating function F w x hav ing a fixed number of parameters w belonging to some set P In this case x and w are real vectors where x z1 25 z4 and w wj ws Wml For a choice of a specific F the problem is to find the set of parameters w that provides the best possible approximation of f on the given input output data set This can be categorized as the learning stage of our approximation problem Therefore it is important to select an approximating function F that can represent f as well as possible It would be pointless to try to learn if the chosen approximation function F w x could only give a very poor representation of f x even when using optimal parameter values Thus we need to distinguish three main problems invloved in function approximation 1 the pro
60. i 0000 00000000 0 2 200000009 0 2 4 5 o 0 x lt gt 0 2 0 2 m5 qa 0 4 0 4 Experimental data Experimental data 0 6 WNtest output 0 6 OWN test output 0 10 t s 20 30 0 10 ts 20 30 Figure 5 14 Comparing the WN test output and the experimental data for vertical scanning at x 0 55 cm as a function of time The resolution for the x data used in the training is 0 1 cm and the resolution for the y data used in the training is 0 02 cm 0 5 1 1 Experimental data o 04 WN test output 0 3 E 0 27 S 0 1 y cm oF a 0 1 coo 0 2 0 3 7 0 4 J Q 1 fi fi fi 0 5 0 4 0 3 0 2 0 1 0 0 1 0 2 0 3 0 4 0 5 x cm Figure 5 15 Comparing the WN test output and the experimental data for vertical scanning at x 0 cm The resolution for the x data used in the training is 0 1 cm and the resolution for the y data used in the training is 0 02 cm 5 2 Training and Testing of Wavelet Network 93 0 5 0 47 Experimental data O WN test output J 0 5 0 47 Experimental data O WN test output 4 Figure 5 16 Comparing the WN test output and the experimental data for vertical scanning at x 0 cm as a function of time The resolution for the x data used in the training is 0 1 cm and the resolution for the y data used in the training is 0 02 cm Normalized Power o io Normalized Power
61. linear models or polynomials of fixed degree to the data in More recently feedforward neural networks have been used to learn the map f 25 Uy gt y i 6 Figure 3 1 a Single neuron model b Simplified schematic of single neuron 25 The basic component in a feedforward neural network is the single neuron model as shown in Figure 3 1 a Where u u are the inputs to the neuron ky k are multiplicative weights applied to the inputs b is a biasing input g R R and y is the output of the neuron Thus we have y g Xen i 1 The neuron of Figure 3 1 a is often depicted as illustrated in Figure 3 1 b where 3 2 Neural networks 33 the input weights bias summation and function g are implicit Traditinally the activation function g has been chosen to be the well known sigmoidal function This choice of g was initially based upon the observed firing rate response of biological neurons A feedforward neural network is constructed by interconnecting a number of neurons such as the one shown in Figure 3 1 so as to form a network in which all connections are made in the forward direction that is from input to output without feedback loops as shown in Figure 3 2 Neural networks of this form are usually Input Layer Hidden Layer Output Layer Figure 3 2 Feedforward neural network 25 composed of an input layer a number of hidden layers
62. norm of function and is the inner product in L R and the sum ranges over all the elements of the family Q 23 27 As mentioned earlier using wavelet frames rather than orthonormal basis provides more freedom and flexibility in the choice of the wavelet function 4 however the tradeoff here is that the reconstruction of the coefficients w in equation 3 6 becomes nontrivial 20 3 4 Wavelet Networks WN 39 3 4 WAVELET NETWORKS WN In this section we discuss the connection between wavelet networks and the discrete inverse wavelet transform In addition we give an overview of the structure of the wavelet network and the process of learning for function approximation 3 4 1 Adaptive Discretization Although the wavelet bases and frames have been developed with efficient numeri cal algorithms their applications have been limited to problems of relatively small input dimension The main reason behind this is that wavelet bases and frames are usually constructed with regularly dilated and translated wavelets independent of the available measured information or training data In practice the construction and storage of such wavelet basis or frame of large input dimension is of prohibitive cost Therefore it is expected that the wavelet estimator will be more efficient if the wavelet basis is constructed according to the training data This inevitably yields the idea of adaptive discretization of the continuous wavelet t
63. o oe oe o oe oe op oo oo oo o oo oo oo oo oo oo oo oo oe oo oo oo oo oo oo oo oo op oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oe oo oe oo o oo o oo oo oo oo oo oo oe oo oo oo oo oo oo oo oo oo oo oo oe oe oo oo oo oo oo oo oo oe oo oo oo oo oo oo oo oo oe oo oo oo oo oo oo oo oo oo oo oo oo oe oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oe oe oo oo oo oo oo oo PS2zero i j tn coordinate of beam spot centre coordinate of beam spot centre PSlzero i j yc 3 y r t d F Specify resolution for the y position Specify resolution for the x position S6 3f 6 3f 12 6f 12 60f 12 6f 512 610 inoutzero PS4zero i j 1 f T y Fr r 2 2 0 01 0 05 0 05 newdivx olddiv nx ny fopen inoutzero txt EN 1 dvx s 1 1 0 01 0 01 PS1zero PS2zero PS3zero PSAzero ength xc ength yc 2 2 1_x 1 dvy 1 else 1_y 1 dvy 1 else newdivy olddiv dvy t 1 1 inoutzero xc i 1_y dvy PS3zero i j 1_x dvx d d d d X y olddiv for t j fprintf fid end end if rem 1_x dvx 40 if rem l_y dvy 40 clear all newdivx newdivy dvx fclose fid ele XC yc dvy nx nx end ny ny end loa loa loa loa fid
64. od o o o o A o o o o o o oe oe o o o o o o o AP AL AL AP AL oe oe o o9 o9 o9 o9 o o o AL AL AL o AY oe 1 s Y filename POWERXY2 m Written by Yasmine El Ashi Fall 2007 0 0000000000000000000000000000000000000000000000000000000000 SS SSSSSS5SSSSo ooS00000000050505050505000000000000000000500000 0e0000000000000000000000000000000000000000000000000000000000 SS SSSSSSSSSS o oo000000005050505050000000000000000000050000 BR ke coke ok ok ck ck ck ck ck kk ke ke check ck ck ck ck ck ck kk koe ck cock ck ck ck ck ck ck RRR KARA RRA KARA ck ck s x Input to the function x Sx r radius of circular beam spot Sx xn x coordinate of the center of the beam spot Sx yn y coordinate of the center of the beam spot Sx xint x coordinates of the intersection points between Sx the circular beam spot and the square photocell Sx yint y coordinates of the intersection points between Sx the circular beam spot and the square photocell x Sx xO x coordinate of the right side of the square S Sx photocell Sx yo y coordinate of the upper side of the square Sx photocell Se c cornenrs of the square inside the circular Sx beam spot Sx Output of the function Sx Power Power at the area of intersection between Sx circlular beam spot and square photocell as the Sx beam spot moves along both the x and y axis eee ee ck
65. of refractive index n light waves 2 1 The Wave Equation 8 travel with a reduced speed pen 2 1 An optical wave is described mathematically by a real function of position r x y z and time t denoted by u r t and known as the wavefunction It satisfies the wave equation 5 1 Oru ly aaa 2 2 where V is the Laplacian operator V 0 0x 0 0y 0 0z Any function satisfying 2 2 represents a possible optical wave Because the wave equation is linear the principle of superposition applies for instance if u r t and uz r t represent optical waves then u r t uy r t ua r t also represents a possible optical wave 13 When electric dipoles are forced to oscillate they induce an electric field that oscillates at the same frequency In addition due to the motion of oscillating charges a magnetic field oscillating at the same frequency is also induced These simultaneous oscillating fields are the basis for all known modes of electromagnetic radiation Thus X rays UV radiation visible light and infrared and microwave radiation are all part of the same physical phenomenon Although each radiating mode is significantly different from the others all modes of electromagnetic radiation can be described by the same equations since they all obey the same basic laws Oscillation alone is insufficient to account for electromagnetic radiation The other important observation is that radiation propagates It is
66. optical power for y 0 35 cm and acquires half of the power at y 0 65 cm Practically by referring to Figure 4 25 the peak normalized voltage for photocell 2 was detected at y 0 67 cm with a voltage percentage deviation of 8 85 The peak normalized voltage for photocell 3 was reached at y 0 74 cm and a percentage error of about 5 9 from the theoretical normalized voltage results At x 0 55 cm as shown in Figure 4 26 the maximum optical power detected for photocell 1 is at y 0 65 cm however when compared to the experimental results the peak value is detected at y 0 66 cm which gives an approximate percentage error of 2 0396 in the y position of the beam center For photocell 4 maximum optical power is attained theoretically at y 0 65 cm while the measured y position for the beam center was y 0 74 cm hence a percentage error of about 13 3 In Figure 4 27 at x 0 55 cm the maximum power obtained through exper iment for photocell 2 was at y 0 68 cm that is a percentage error of 4 6096 in the y position of the beam center and for photocell 3 the maximum power obtained was at y 0 77 cm thus giving us an error of 18 1 At x 0 cm the maximum theoretical normalized optical power is 0 3811 for all photocells where photocells 1 and 2 attain it at y 0 65 cm and photocells 3 and 4 reach it at y 0 65 cm As can be seen from Figure 4 28 photocells 1 and 2 gained maximum optical po
67. p Yn Aag 1 1 amp XY es ai U 1 p 1 n 1 No N LLE rof Ee p Yn Aan 1 1 28 x Drago es 8 Since Oy ne ee 29 TA Ong 29 equation 28 can be rewritten as N 1 p Aag D id gt eta yAagi l 1 30 p p 1 Let Dwoi DW be a 3D array with N pages where each page constitutes of the following matrix db dal dai da N db dab deb gt da N DW f 31 dp da 5 dE del ddr da 4 e dahi dal N Next we can define the page vectors DWoi k 1 Dby and DWoi k i Day as stated below Db db db so bl wes bus Er 32 and Dax da dal da e der a4Eex 33 9 Backpropagation Algorithm 176 The components of Db and Da are computed as follows for k 1 No DWoi k 1 E k u end for k 1 No for i 1 Ni DWoi k itl E k u x 1 end end Let M E db mean Db gt ua 34 p p 1 and N 1 p day mean Dax x gt petat l 35 p p 1 Thus we can define the matrix DWoi aver DW as follows db d i1 TERR day seme d iN dba das Some dao PEER dan DWy C MENU 36 db day d y c dan dby d Ni Soin dani cene d N N The matrix DW is computed using the code for k 1 No for i 1 Ni 1 DWoi_aver k i mean DWoi k i end 3 Backpropagation Algorithm 177 end In matrix form equations 27 and 30 can be stated as AWga
68. paraxial Helmholtz equation a shifted version of it with z replacing z where is a constant 2 A r ZU exp 1 2 48 where q z z This provides a paraboloidal wave centered about the point z instead of z 0 When is complex equation 2 48 remains a solution of equation 2 46 but it acquires dramatically different properties In particular when is purely imaginary for instance jz where Zp is real equation 2 48 gives rise to the complex envelope of the Gaussian beam A r A q z exp jkp 2q z with q z z jz In this case the parameter zo is known as the Rayleigh range To separate the envelope and the phase of this complex envelope let 1 1 m m meque e ce 2 49 qlz z jzo z 3j29 2 Thus we can write 1 q z as 1 1 4 2 50 ae REG IWE e where 1 E 2 3 Wavefronts 24 and A 20 TW 2 z 2 2 Thus R z can be expressed as ro 533 sb 8 While W z can also be represented as a function of z and zo in the following manner 2 2 2 Ww z T 2 z 3 1 A NP 1 2 E ie qe emp T r4 Zo Before proceeding further into our derivation let us define the following 2 2 2 2 2 1 arg q z tan 1 2 NF So l 1 2 la 2 Substituting equation 2 50 into equation 2 48 and using U r A r exp jkz we can deduce the following
69. signed number 4 valid range is 32768 to 432767 Input none Output 16 bit signed number If you enter a number outside 32767 it will truncate without an error Backspace will remove last digit typed extern signed int SCI1_InSDec void les SCI1_InSLDec InSLDec accepts ASCII input in signed decimal format and converts to a 32 bit signed number Ae valid range is 2 147 483 648 to 2 147 483 647 Input none Output 32 bit signed number If you enter a number outside 2147483648 it will truncate without an error Backspace will remove last digit typed extern signed long SCI1_InSLDec void SCI1 InUHex Accepts ASCII input in unsigned hexadecimal base 16 format Input none Output 16 bit unsigned number Just enter the 1 to 4 hex digits It will convert lower case a f to uppercase A F 24 and converts to a 16 bit unsigned number value range is 0 to FFFF Appendix D Microcontroller Code 207 If you enter a number above FFFF it will truncate without an error Backspace will remove last digit typed extern unsigned short SCI1_InUHex void El SCL1 0utStatus Checks if output data buffer is empty TRUE if empty Input none Output TRUE if a call to OutChar will output and return right away id FALSE if a call to OutChar will wait for output to be ready extern char SCI1_OutStatus void if
70. the matrix y Y consists of the desired output data that will be used for WN training where the number of columns equal N and the number of rows equal No the total number of output variables Next the following parameters are defined u 0 01 Setting the learning rate gamma 1 u Setting the momentum coefficient Ax size x Ay size Y Np Ax 1 1 sno of patterns Ni Ax 1 2 sno of input nodes N1 3 Sno of levels Nw 2 N1 1 no of hidden nodes No Ay 1 1 no of output nodes You only need to manually set the value for the learning rate u and the number of levels N1 1 1 Initializing Wo and Wy The matrix Won which consists of the weights ck as shown in equation 5 3 is first initialized to zeros as follows Woh zeros No Nw The matrix W which consists of the direct linear coefficients between the input and output layers as shown in equation 5 2 is initialized using the least 1 WN Initialization 154 squares method First let us recall the feedforward equation for the kth output of the WN for a certain pattern p given by the following equation Nw Ni GR N cag Bit o Lasst de 1 j 1 i 1 By only considering the linear part for the feedfoward equation the WN output in equation 1 can be reduced to the following Ni Jk bk apit 2 1 Equation 2 can also be written as Ni r p br V ariz p 3 i 1 By assuming the direct connections only fx p
71. 0 Appendix A Matlab Codes 144 x y 1 f h 1 h h DisplayName P2 abel y cm igure 10 andlevector 1 p LineWidth 2 Col old on WN output abel Normalized Power egend handlevector 1 2 lot Y 2 f 1 f end x f 1 f end 3 lor 0 0 0 DisplayName P3 Desired Output andlevector 2 p Lot Y_hat 2 1 end x 1 end 3 Marker square LineStyle none Color 0 0 0 x y 1 f h h h h DisplayName P3 andlevector 1 p LineWidth 2 Col old on WN output abel y cm abel Normalized Power egend handlevector 1 2 igure 11 old on lot Y 2 1 end x 1 f end 4 lor 0 O 0 DisplayName P4 Desired Output andlevector 2 p Lot Y_hat 2 1 end x 1 f end 4 Marker LineStyle none Color 0 0 0 x y DisplayName P4 abel y cm WN output abel Normalized Power legend handlevector 1 2 t oc 145 Appendix A Matlab Codes AP AP oe o o AP AP o oe oe o o o o o o o oe oe oe JP oe oe o o AP AP o oe oe oe oe oe oe o o oe oe oe o o o AP oo oo oo oo oo oe o o oe oe oe oe o oe o oo o oe oo oe o oe o oe o oe o oe o oe oO o oe oe oe se oe oe oe oe y oe oe ove oo Q D oe oe o o9 r4 o oe oe oe Q O oe oe o9 o9
72. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 0 00 0 00 0 0 0 00 0 0 0 0 0 00 00 0 0 0 0 0 0 0 0 00 O Le clear all for k 1 10 for p 1 10 epsn 0 1x k 1 SEpsilon horizontal gap dita 0 1 p 1 Delta vertical gap xs1 0 5 epsn 2 ys1 0 5 dlta 2 Centre of photocell 1 xs2 0 5 epsn 2 ys2 0 5 dlta 2 Centre of photocell 2 xs3 0 5 epsn 2 ys3 0 5 d1ta 2 Centre of photocell 3 xs4 0 5 epsn 2 ys4 0 5 d1ta 2 Centre of photocell 4 xc 2 0 01 2 x coordinate of the beam spot center yc 2 2 0 01 2 y coordinate of nxc length xc nyc length yc the beam spot center Xc 1 7xc xs1 Yc 1 yc ys1 Xc 2 xc xs2 YC 2 yc ys2 Xc 3 xc x8s3 YC 3 yc ys3 Xc 4 xc xs4 Yc 4 yc ys4 load Pcentre SNormalized power for one photocell V 3 0 01 3 SRange for the x and y plane for Pcentre nxV length V nyV nxV vx 1 1 find abs V Xc 1 1 gt 0 amp abs V Xc 1 1 0 001 vx 1 2 find abs V Xc 1 nxc gt 0 amp abs V Xc 1 nxc lt 0 001 vx 2 1 find abs V Xc 2 1 gt 0 amp abs V Xc 2 1 lt 0 001 vx 2 2 find abs V Xc 2 nxc gt 0 amp abs V Xc 2 nxc lt 0 001 vx 3 1 find abs V Xc 3 1 gt 0 abs V Xc 3 1 lt 0 001 vx 3 2 find abs V Xc 3 nxc gt 0 amp abs V Xc 3 nxc lt 0 001 vx 4 1 find abs V
73. 0 1 0 1 0 2 0 2 0 3 Theoretical model 0 3 A O WNtest output d 0 4 0 10 20 30 40 0 10 t s 20 30 40 t s Figure 5 22 Comparing the WN test output and the theoretical model with gaps for vertical scanning at x 0 cm as a function of time used in the training is 0 05 cm and the resolution for is 0 02 cm The resolution for the x data the y data used in the training H MSE 6 MSE 10 E LLI ep gt 10 J 107 L L kii cl piiit pid 10 10 10 10 No of Wavelons N Figure 5 23 Comparing the MSE values vs N after training the theoretical model with gaps and after testing for the experimental data set at x 0 cm The resolution for the x data used in the training is 0 05 cm and the resolution for the y data used in the training is 0 02 cm 5 2 Training and Testing of Wavelet Network 98 0 4 Experimental data 0 37 O WNtest output WH 0 2r 990000 0 17 0 1 0 2 0 3 zl 0 4 0 3 0 2 0 1 0 0 1 0 2 0 3 0 4 Figure 5 24 Comparing the WN test output and the experimental data for vertical scanning at x 0 cm The resolution for the x data used in the training is 0 05 cm and the resolution for the y data used in the training is 0 02 cm 0 4 0 4 0 3 0 3 0 2 0 2 0 1 0 1 S on 5 o x gt 0 1 0 1 0 3 Experimental data 0 3 Experimental data O WN test out
74. 00000 SESESEEEEEEEEESEEEEEEEESEEEESEEEESEEEESEEEEESEEEESEEEESEEEESS fE A E N SE E O S gt al bas oa Sak al a Sal E ual al a a al al Sa a a a al ad a al a al a a al al al al al al a a a alo al al ao al oa al ooo a ooo N E N SS SSSSSS5SSSSo o oo000000005005050500000000000000000005050000 Sk kk ke ke coke ok ok ck ck ck ck ck kk ke ke check ck ck ck ck ck ck ck kk ck check cock ck ck ck ck ck ck ck KAR RRA ee ee eae ck ck 5 x Input to the function Sx r radius of circular beam spot Sx xn x coordinate of the center of the beam spot Sx yn y coordinate of the center of the beam spot Sx xint x coordinates of the intersection points between Sx the circular beam spot and the square photocell Sx yint y coordinates of the intersection points between Sx the circular beam spot and the square photocell Sx xO x coordinate of the right side of the square Sx photocell Sx yo y coordinate of the upper side of the square x Sx photocell Se c cornenrs of the square inside the circular Sx beam spot Sx Output of the function Sx Area Area of intersection between circle and square Sx as circle moves along y axis eee ee ck ck ck ck ke ck ke RKA KARA KARA RRA KA KA KARA RRA A KARA RRA KA KARA function Area AREAY2 r xn
75. 16 5 17 Plot of MSE vs Iterations for different values of N where the theo retical model without gaps is used for training the WN u 0 1 y Odiseo eH EG ORO EG 3 s OR we a G Plot of MSE vs Iterations for different values of u where the simulated data without gaps is used for training the wavelet network Nu 63 Comparing the MSE values vs N after training the theoretical model with gaps and after testing for the theoretical data set at x 0 cm The resolution for the z data used in the training is 0 1 cm and the resolution for the y data used in the training is 0 02 cm Comparing the WN test output and the theoretical model with gaps for vertical scanning at x 0 cm The resolution for the x data used in the training is 0 1 cm and the resolution for the y data used in the training is 011 ON qux uf eL OR RS x3 ko Cee ee SE Ee E Be Comparing the WN test output and the theoretical model with gaps for vertical scanning at x 0 cm The resolution for the x data used in the training is 0 1 cm and the resolution for the y data used in the training is 0 02 ON lt lt prosas seo E ra AA Comparing the WN test output and the theoretical model with gaps for vertical scanning at x 0 cm The resolution for the x data used in the training is 0 1 cm and the resolution for the y data used in the trainime is 0 02 Gms EE De eS EE Be ew a a Comparing the WN test output and the experimental data for vertical scanning at x
76. 3 4 2 Wavelet Network Structure Zhang and Benveniste introduced the general wavelet network structure based on the so called 1 4 layer neural network 23 In the next discussion we use the modified version of this network presented by Zhang in 28 The main difference between the two approaches is that in 28 a linear term ay ax1 dx2 aii is introduced to help the learning of the linear relation between the input and the output signals The WN architecture used is shown in Figure 3 5 and the equation that defines the network is given by Nw Ni jk a XC ej 2 Y ayers br 3 10 j l i l where 1 is the index for input nodes j is the index for hidden nodes k is the index for output nodes N is the number of input nodes N is the number of hidden nodes and N is the number of output nodes As shown in Figure 3 5 the wavelet network is composed of an input layer with N inputs a hidden layer having N wavelet neurons or wavelons and an output layer having a linear output neuron The coefficients of the linear part of the network which consist of the components of the vector ay and the bias term bj are called direct connections 27 In addition x refers to the ith input to the network x is the kth output of the network and 6 x represents the multidimensional activation function at the jth hidden wavelon For modeling multi variable processes multidimensional wavelets RW R must b
77. 4 74 74 04 PM OPEN DM PN NNW W gt gt gt gt O O O O qgaaaa GO 00 aaaa SOSA PS1 201 201 k psi k end 0 0 1 0 9 SPlot of normalized power of photocell 1 at plot epsn ps1 epsn Epsilon an VS 0 0 Appendix A Matlab Codes 136 299 999990000999 9 9999000009099999 9999900999999999000009999 99990000090 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 00 0 0 0 00 00 0 0 0 00 0 0 0 00 00 0 0 0 00 0 0 0 0 0 0 0 0 000 299 999090000999 9999900090099999 9999090099999 9999000009999 9999000009 00000000000 000000000000000000000000000000000000000000000000000000 55 Power calculation program for a quad cell photodetector 55 array at different values for Epsilon and Delta while SSS 525 moving the beam spot along both the x and y axis SSS 55 filename Quadcell_POWER_modifiedfurther2D m 55 9 9 9 22 000 000 Written by Yasmine El Ashi Fall 2007 SSS T 0 0 goo a OO 8 6 2G 07 0 2 C020 8 0 12 8x0 SCS 0 6 0 22 0 0 0 0 00 0 0 09 6 OO 6 0 0 0 0 2 D 000 0 0 00 O D GE 0000000000000 7O 70 7O 70 70 70 70 7O 70 70 70 70 CO 70 70 O0 70 0 70 70 70 70 70 70 70 70 70 70 70 0 70 70 70 70 70 70 0 0 70 70 70 70 70 70 70 70 0 70 0 000 9 9 0 9 0 9 0 0 0 0 0 0 0 O 0 0 0 O 0 0 0 0 0 0 0 9 O O O 0 0 0 0 0 0 0 0 0 0 0 0 O 0 0 0 0 0 0 0 0 000000000900 0 0 0 0 0 0 0 0 0 0
78. 5 d1ta 2 Centre of photocell 4 xc 2 0 01 2 x coordinate of the beam spot center yo 2 0 01 2 Sy coordinate of the beam spot center nxc length xc nyc length yc Xc 1 xc xs1 Yc 1 yc ysl Xe 2 xc xs2 YCc 2 yc ys2 Xe 3 xc xs3 YcC 3 yc ys3 Xc 4 xc xs4 Yc 4 yc ys4 load Pcentre Normalized power for one photocell V 3 0 01 33 SRange for the x and y plane for Pcentre nxV length V nyV nxV vx 1 1 find abs V Xc 1 1 gt 0 abs V Xc 1 1 x0 001 vx 1 2 find abs V Xc 1 nxc gt 0 amp abs V Xc 1 nxc 0 001 vx 2 1 find abs V Xc 2 1 gt 0 abs V Xc 2 1 lt 0 001 vx 2 2 find abs V Xc 2 nxc gt 0 abs V Xc 2 nxc lt 0 001 abs V Xc 3 1 lt 0 001 vx 3 1 find abs V Xc 3 1 gt 0 gt 0 abs V Xc 3 nxc lt 0 001 vx 3 2 find abs V Xc 3 nxc abs V Xc 4 1 0 001 vx 4 1 find abs V Xc 4 1 50 amp gt 0 amp abs V Xc 4 nxc 0 001 vx 4 2 find abs V Xc 4 nxc abs V Yc 1 1 0 001 vy 1 1 find abs V Yc 1 1 gt 0 gt 0 amp abs V Yc 1 nyc lt 0 001 vy 1 2 find abs V Yc 1 nyc N abs V Yc 2 1 lt 0 001 vy 2 1 find abs V Yc 2 1 gt 0 gt 0 amp abs V Yc 2 nyc lt 0 001 vy 2 2 find abs V Yc 2 nyc amp abs V Yc 3 1 lt 0 001 g
79. 5 3 we have 3 levels that is N1 is set to 3 hence Nw the number of wavelons is 7 In addition given such an example each input variable is assumed to have a range of 1 1 Therefore the following parameters ak and bk can be defined in our code as ak min x bk max x where ak 1 1 1 1 and bk 1 1 1 1 provided that we have four input variables that is Ni 4 The block of code used for the dyadic initial ization is given as follows for i 1 Ni for L 1 Nl div bk i ak i 2 L n 1 p 0 while pzbk i p ak 1 i nxdiv 1 WN Initialization 158 end M n p D n div n n 1 end for w 1 n 2 f 1 w L M 2xw 1 g 1 w L D 2 w 1 end end F squeeze f G squeeze g pf qf find F 0 pg q9 find G 0 for w 1 length pf s w F pf w qf w end if F 1 1 0 m i F 1 1 s elseif F 1 1 0 m i s end for w 1 length pg t w G pg w qg w end if G 1 1 0 d 1 G 1 1 t elseif G 1 1 40 d i t end The main for loop is repeated Ni times such that at every new entry of the value i the column vectors m i m and d i dj are initialized 1 WN Initialization 159 where TI dii Moi dy mi TE TIN i dw i First let us set i 1 and L 1 In addition let div bk i ak i 2 L Ax represent the differential distance between each interval if the transla tion sc
80. 55 Given diameter of the circular beam spot is equivalent SSS 55 to one side of the square photocell 55 55 filename POWERY2 m 55 55 525 Written by Yasmine El Ashi Fall 2007 SSS SESSSESCEEEEEEE ESE SE SSS SES ESEESEEEEEEEES ESSEC SCSEEEEEEEEEESESSESSESSSSSS SESCSSCSEEEEEEEEE ESE SSS SESE EETEEEEEEEE SE SES SCSEEEEEEEEEEESESSSSSSSS Sk kk ke ke coke ok ok ck ck ck ck ck kk KR I RR RRR KK KKK KK KK KS x Input to the function x Sx r radius of circular beam spot Sx xn x coordinate of the center of the beam spot Sx yn y coordinate of the center of the beam spot Sx xint x coordinates of the intersection points between Sx the circular beam spot and the square photocell Sx yint y coordinates of the intersection points between Sx the circular beam spot and the square photocell x Sx xO x coordinate of the right side of the square Sx photocell Sx yo y coordinate of the upper side of the square x Sx photocell Se c cornenrs of the square inside the circular Sx beam spot Sx Output of the function Sx Power Power at the area of intersection between Sx circlular beam spot and square photocell as the Sx beam spot moves along y axis BK KK KK ck ke ck KK A KA ck ck ck ke RR RA KA KAR ARA RRA KA KA KR KKK KK KKK KKS function Power POWERY2 r xn yn xint yint xo yo c lamda 6 33e 05 SWavelength of a He Ne laser sour
81. 6 Recently the wavelet theory has received substantial interest in the fields of numerical analysis and signal processing 17 18 Wavelets are a family of basis functions which exhibit interesting properties such as orthogonality compact support and localization in time and frequency 19 Owing to wavelet theory very efficient and fast algorithms have been developed for analyzing approximating and estimating functions or signals However the implementation of such algorithms is only adequate for problems of a relatively small input dimension This is due to the excessive cost of constructing and storing wavelet basis of large dimension Artificial neural networks are considered more promising candidates for handling problems of larger dimension and their complexity is less sensitive to the input dimension 20 Neural networks have been established as general function approximation tools for fitting nonlinear models from input output data and are widely used in applica tions which involve system modeling and identification 16 However the practi cal implementation of neural networks suffers from the lack of efficient constructive methods both for determining the parameters of neurons and selection of the net work structure At a different rate the recently introduced wavelet decomposition is emerging as a powerful tool for approximation 21 22 Due to the similar struc ture of wavelet decomposition and one hidden layer neural net
82. 7 Plot of photocell output voltage vs y position of the center of the beam while setting the z position at 0 55 cm 4 3 Experimental Study of the Position Detector 79 0 4 T T T T T T I n Pi v P2 0 35 P3 o P4 0 3 J Photo Voltage Vo V o o a o to al m al T T T e zu Figure 4 28 Plot of photocell output voltage vs y position of the center of the beam while setting the x position at 0 cm and the y position of the beam center However Figures 4 26 and 4 27 have only shown a slight shift in the y position To scan the beam spot along the y axis of the quadcell detector at a fixed x position an initialization point has been selected such that the beam center is located at the upper right corner of photocell 1 This initial position of the beam center is adjusted manually until the normalized power acquired by photocell 1 is 0 25 0 1 However with this setting we have a position uncertainty of As y A Ay where 0 01 cm lt As lt 0 1 cm This leads to inaccuracies in both the x and y positions of the beam center as can be seen in Figure 4 29 A shift in the x and y positions of the beam center can cause a deviation between the measured voltage and the corresponding theoretical normalized spatial optical power distribution In theory the beam diameter is assumed to be exactly equal to the side of the square photodetector and 99 of the optical power is contained within
83. 70x80 otherwise the system hangs continous interrupts Y OS ASE xk xx communication interface kk x O P send single character i SCI1_OutChar Wait for buffer to be empty output 8 bit to serial port busy waiting synchronization Input 8 bit data to be transferred Output none void SCI1_OutChar char data wait until there s space in the ring buffer while RB_FULL amp out place character to be sent in the buffer x RB PUSHSLOT amp out data set write position for the next character to be sent RB PUSHADVANCE amp out SCI1CR2 0x80 re enable interrupt x s SCILOutChar 7 O P send entire string void SCI1 OutString char xpt while pt SCI1_OutChar pt PETT Y SCI1_OutString Appendix D Microcontroller Code 210 I P get single character x char SCI1 InChar void Char c wait until there s data in the ring buffer while RB EMPTY amp in get character off the buffer c RB_POPSLOT amp in set write position to the next free slot x RB POPADVANCE amp in rot rn c Y x SCI1_InChar SCIl Imnat Initialize Serial port SCI1 Input baudRate is tha baud rate in bits sec Output none void SCI1_Init unsigned short baudRate set up input and output ring buffers x RB INIT amp Out outbuf 255
84. A A od ge oe oe p U oe oe o9 o r4 O o oe oo 3 o oe oe oe O o oe oe oe oe oe oe oe P D oe oe oe oe 3 G oe oe oe oe Q A oe oe oo oe G N o oe oe o9 H 3 E O oe oe oe oe O oe oe oe O amp Oo C oe oe de de c O el N oe oe oe oe Q A oA oe oe oo oe A P FE rj o9 oe oe oe P OG o H oe oe o0 o0 H E oO oe oe oo oe J A nm Ey oe oe o oo E X oe oe oe oe Oo xe oe oe vo YY y dA oe oe o o0 O Q oO G oe oe o o H Q YM oe Ae o oe t9 y Ko oe o o O O 9e oe oo oe GC O uy H oe oe oe oe H O GS E oe oe de oe PH ON oe oe de ode Q pedo U oe oe o oo Q O D 2 G oe oe oe oe p G go O d o9 oe o oe SNS E oe oe o9 oe M H H gt U oe oe oe oe y n 0 DU oe oe o oo O GO z H oe oe oe ode x OH oe oe o0 p 2 D Ae ove oe O H d Il gt 09 oe oo oe GCS gt Q oe oe o oe se Q oe oe oe oe p G oe oO Q DD z O Q oe oe oe oe HOE d Y oe oe oo oe O Q 0 49 oe oe o9 o0 gt PY n do oe o0 oe G D O dH Y oe oe o oe Z OW H f oe oe oe oe oe oe oe 9 0 6 0T 0 02 20 99 u 2 63 0 1 divy 6 Nw O O exp 0 5x z 3 1 yy 63 gamma E 6 Nw 10to4 LS init Wavelon init testing neg0 55 divx tx rest Y test size x test N 1 1 gaussian Nl FA dE xexp 0 5 z j i 2 1 MSE test6 gaussian Nl phi 3 1 0 02 z 35 i PHI 1 3 1 m 3 1 z 3 1 10to4 LS init Wavelo
85. AAx BBx beta2 betal F Power Pc P1 Case 6 elseif yn Power Pc end end BBx beta2 betal F Centre of circle less than or equal to yo BBx beta2 betal F Centre of circle between 0 and yo Centre of circle between yo and 0 Centre of circle greater than or equal to yo 2 2 upper half of square 2 lower half of square s 2 7 Centre of circle at the origin of the coordinate system Appendix A Matlab Codes 128 o oe oo oe o oe o oe oe oe o oe o oe o oe o oe o oe o oe o oe oe oe oe oe o oe oe oe o oe o oe o oe o oe o oe oe oe o oe oe oe oe oe o oe oe oe o oe o oe o oe o oe o oe oe oe oe oe oe oe oe oe o oe o oe o oe o oe o oe o oe o oe o oe oe oe o oe oe oe o oe o oe o oe o oe o oe o oe oe oe oe oe oe oe oe oe oe oe o o9 o9 o9 o9 o o o o o AAP oe oe oe o o o o o Ae o o9 o9 o9 oe oe oe oe o oe o o o o o o o o A o o o oe oe Q w ER Q E E e ct 0 ct B oO FU O 0 H E Function to at the area of between circular beam spot and the square photocell Center of circular beam spot is moving along both the x and y axis while the square photocell is fixed at the origin of the coordinate system Given diameter of the circular beam spot is equivalent to one side of the square photocell O lt Oo H E w o
86. D array with N pages where each page constitutes of the matrix p p p p 211 A 777 ZIN p p p p 231 229 00 Za 00 ON Z p p p p i 92 ji ZjNi p p p p ZN Nw2 Ni ZN N Each element zi is represented by the following equation Bi 0 T 2 17 Therefore in order to batchly compute the elements of the 3D array Z we need to introduce a term known as page vector which is a vector that extends across all the pages of a 3D array at a certain row and column Consequently 2 Feedforward Algorithm 170 the page vector z j i Zj can be stated as follows Zji 1 zi ji ji Ze The symbol in equation 18 represents an element by element multiplica tion The line of code used to replicate equation 18 is as follows z j i x i m j 1i d 4 1 Next let us define phi y a 3D array with N pages where each page constitutes of the matrix p p p p Pi Pri cc Pr Pin p p p p P21 Yoo Pa cc Pon Dp p p p p Pj Qi Pi o Pin p p Taal p wack p CN VN 2 PNwi PNwNi Each element 5 is represented by the following equation D oh Q5 Y 25 z exp DX 19 2 Feedforward Algorithm 171 In order to batchly compute the elements of the 3D array y we will define the following page vector i 5 ee Pai Np Pr The line of code used to compute phi j i qj is as follows phi j i z j i xexp 0 5x z j i CA DE S
87. DRE SCI1_InString This function accepts ASCII characters from the serial port and adds them to a string until a carriage return is inputted Ll or until max length of the string is reached It echoes each character as it is inputted If a backspace is inputted the string is modified and the backspace is echoed InString terminates the string with a null character Appendix D Microcontroller Code 213 Modified by Agustinus Darmawan Mingjie Qiu void SCI1_InString char string unsigned short max int length 0 char character character SCIl_InChar while character CR if character BS if length string length SCI1_OutChar BS else if length lt max string character length SCI1_OutChar character character SCIl InChar string 0 EX ifdef ERAS if SCI1_InUDec InUDec accepts ASCII input in unsigned decimal format and converts to a 16 bit unsigned number valid range is 0 to 65535 Input none Output 16 bit unsigned number If you enter a number above 65535 it will truncate without an error Backspace will remove last digit typed unsigned short SCI1 InUDec void unsigned short number 0 length 0 char character character SCI1_InChar while character CR accepts until carriage return input The next line checks that th
88. EERE OR 36 3 5 Function approximation using wavelet networks 41 4 1 Hardware architecture of the proposed position detection system 44 4 2 Parameters definition for area Ay 45 43 Parameters definition for area Ay lt lt 48 44 Parameters definition for area Az o ee ee 50 4 5 a Case 1 z gt zo b Case 2 x lt Zo c Case 3 0 x lt zo d Case 4 z9 lt x lt 0 e Case 5 x 0 f Case 6 x gt zo4d po 98 4 6 a Case T y 2 yo b Case 8 y yo c Case 9 0 y yo d Case 10 yo y 0 e Case 11 y 0 f Case 12 y y gt yo po 58 4 7 Example of beam center position as it scans the photocell s regions 62 4 8 Quadcell array of photodetectors 65 4 9 The normalized power obtained by photocell 1 as the beam center scans th quadecll plane 2 eso oos 9o di 66 4 10 The normalized power obtained by photocell 2 as the beam center scans the quadcell plane o 66 4 11 The normalized power obtained by photocell 3 as the beam center scans the quadcell plane a ee 40K 244 eran RR RE 67 4 12 The normalized power obtained by photocell 4 as the beam center scans the quadcell plane 2 2 ee 67 4 13 4 14 4 15 4 16 4 17 4 18 4 19 4 20 4 21 4 22 4 23 4 24 4 25 4 26 4 27 4 28 4 29 5 1 5 2 5 3 5 4 5 9 Quadcell arrangement
89. Eor sS Appenndix B User Manual for Wavelet Network Code This is a user manual to explain the command lines for the wavelet network training code for multiple input multiple output MIMO function approx imation The code can be divided into three main sections namely WN initialization feedforward algorithm and backpropagation algorithm Before running the code the input output data should be saved in the same directory as a txt or MAT file The data should be stored as a 2 dimensional matrix where the number of rows indicate the number of patterns or observations available and each column represents either an input or output variable 1 WN INITIALIZATION First load the input output data file load inoutzero txt sInput data x inoutzero 3 inoutzero 4 inoutzero 5 inoutzero 0 Desired output data Y inoutzero 1 inoutzero 2 Y Y Let us define the column vector and the row vector Y ul Ye cc UR 1 WN Initialization 153 such that the input matrix X Xi Xa co Xj o Xy and the output matrix Y Y Ye Yn In this case the input output file inoutzero txt contains 4 input variables allocated in columns 3 4 5 and 6 as well as 2 output variables in columns 1 and 2 Thus on the one hand the matrix x X consists of the input data where the number of rows equal the number of patterns N and the number of columns equal the number of input variables N On the other hand
90. H 0 L 13 BUSCLOCK x PLL not used 4e6 16 baudrate SYNR REFDV 250000 baudrate 0 gt factor 2 Appendix D Microcontroller Code 212 SCI1CR1 0 bit value meaning LOOPS no looping normal WOMS normal high low outputs RSRC not appliable with LOOPS 0 M 1 start 8 data 1 stop WAKE wake by idle not applicable ILT short idle time not applicable PE no parity PT parity type not applicable with PE 0 C 1 BS U AS G O Q oO O OO O O O O SCI1CR2 OxAC enable both RX and TX interrupts x bit value meaning 7 0 TIE transmit interrupts on TDRE 6 0 TCIE no transmit interrupts on TC 5 il RIE receive interrupts on RDRF 4 0 ILIE no interrupts on idle 3 1 TE enable transmitter 2 al RE enable receiver 1 0 RWU no receiver wakeup 0 0 SBK no send break x j n SCI1_InStatus Checks if new input is ready TRUE if new input is ready Input none Output TRUE if a call to InChar will return right away with data 14 FALSE if a call to InChar will wait for input char SCI1_InStatus void return SCI1SR1 RDRF SCI1_OutStatus Checks if output data buffer is empty TRUE if empty Input none Output TRUE if a call to OutChar will output and return right away if FALSE if a call to OutChar will wait for output to be ready char SCI1_OutStatus void return SCI1SR1 T
91. Kopiu eoa d a1 T WA 2 5 2 1 0 3 af S oe jan exp Css S da a2 a2 WA NE 2 1 0 2 u 5 Fam da f exp al a da Ki m ca f exp 5g da sino a1 Therefore P can be stated as a2 P kK1kKa 0 01 f exp de da 4 29 ei sin o 4 2 Theoretical Optical Acquisition Model 55 where 2 Es yz 2 4 30 2 2 2 Ko exp jan 4 32 Next we investigated how the optical power intercepted by one photocell changes as the beam center moves along the x direction only This can be divided into six different cases as follows if Case 1 x gt xp then d Lo a sin 4 po and the power of the shaded region is P P else if Case 2 x ro then dy L T a sin po and the power of the shaded region is P P else if Case 3 0 x x then dy L T a sin 4 po pre and the power of the shaded region is P Pr P else if Case 4 z9 lt x 0 then d zo sin 4 P P and the power of the shaded region is P Pr P else if Case 5 x 0 then The power of the shaded region is P Pp else if Case 6 z x gt o po then The power is P 0 4 2 Theoretical Optical Acquisition Model 56 Where Pr 271 T 1 k2 is the total power of the beam spot with radius 0 5 cm The power while the beam is moved along the y direction only can be determined using the
92. MODELING AND ANALYSIS OF A WAVELET NETWORK BASED OPTICAL SENSOR FOR VIBRATION MONITORING A THESIS IN MECHATRONICS Presented to the faculty of the American University of Sharjah School of Engineering in partial fulfillment of the requirements for the degree MASTER OF SCIENCE by YASMINE AHMED EL ASHI B S 2006 Sharjah UAE 2010 YASMINE AHMED EL ASHI ALL RIGHTS RESERVED We approve the thesis of Yasmine Ahmed El Ashi Date of signature Dr Rached Dhaouadi Associate Professor Electrical Engineering AUS Thesis Advisor Dr Taha Landolsi Assistant Professor Computer Engineering AUS Thesis Co Advisor Dr Khaled Assaleh Associate Professor Electrical Engineering AUS Graduate Committee Dr Ameen El Sinawi Associate Professor Mechanical Engineering AUS Graduate Committee Dr Rached Dhaouadi Associate Professor Coordinator Mechatronics Engineering Graduate Program Dr Hany El Kadi Associate Dean College of Engineering Dr Yousef Al Assaf Dean College of Engineering Mr Kevin Lewis Mitchell Director Graduate amp Undergraduate Programs amp Research MODELING AND ANALYSIS OF A WAVELET NETWORK BASED OPTICAL SENSOR FOR VIBRATION MONITORING Yasmine Ahmed El Ashi Candidate for Master of Science in Mechatronics Engineering American University of Sharjah 2010 ABSTRACT The main objective of this research is to present a wavelet network based o
93. N ON ON CONI CQ ON QN QN on m m Vo nos o nos o os ox o os oe o os ox dam sr dam st HNM sf dams oat TERR as om Bo Bo eet Ids e UE DRAE A e ie QN OQ QN ON l l X x Xx X x XxX Xx X Z4 D4 D4 DU Du 74 74 04 LES R2 22 iilii J777 TITI 77 gees N N AS gt gt gt gt gt gt gt gt gt gt gt gt gt gt gt gt gt x x KK 0 0 X x Xx X x Xx Xx X DA D4 DA Du DA DA DA Du AQAA D m agua G a G G G E A G SSSSs ee ee ee oe dG Ag toi oto foi ow g toi ot gu toi ot al OM x om nano annann annaa annaa ddd o mom st st NN AN NN NA ON NNN AN NANA AN CCS bci ed Sor od MON OM MON N MN OM MON OM ANN sr O O0 U U dam st cM QNO st HNM sf HNM os Se a iia A x Xx X X xX XXX Du 74 DA RDA D4 D4 D4 4 QA QA TUT DU Annan TODO Cu E AA DR d Er gt gt gt gt o eno eno es oen on n es oen n t PU HR NA CK 0000 Se E id fod c dH 4 4 od tae ot fad 4 4 4 OM NH an n 0 b d d t 4 I old t 4 Doo Q Q reo AA AA A AAJA GaaqaGg d DUO 04 n uH oL eX ol oc n n Ec oec oed oo vo WO Se MON nos MON ON M OPEP MOM ON M O 0 0 O og BE dno st dam st HNM Y HNM Y pon pen Uoc ded x x Xx X x Xx Xx X Z4 D DA DU Du D4 DA D aa H H H H gt PPP CO OO gt Pp DUDO A A oil sll to wo tow eo tot teal tot tal SSNs IN IN add ddd ode e on n X S ES e mom st ot dam st dam st HNM Y HNM Y m Se ee u er AA ME Mid uM RIP M Re G Re AA nee AA iA e OON sr Z4 A 24 4 Xx Xx Xx X x Xx Xx X D
94. Np UF Np C Np s Np C Np Us Np 1 gt UE Np p N Y N Uj N Ct Np C Np Uk Np O p Ye Np Yg Np C Np Ux Np 9 To minimize Jy with respect to Uz Np we set adn BU Ny 9 Np U Np C Np Y Np 0 10 Let us denote U N that satisfies equation 10 as U Np Then we have C Np C Np Ux Np C Np Ys Np 11 In this analysis we assume that CT N C N is nonsingular therefore the inverse of CT N C Np exists Hence solving equation 11 for Np we obtain Ux Np CT Np C Np CT Np Ye Np 12 Therefore the following for loop is used to initialize the matrix Wy I ones 1 Np input I x Sinput matrix C input 1 WN Initialization 157 for k 1 No Woil inv C C C Y k Woil Woil Woi k Woil end where c C Np Y k Yp Np and Woil Us N 1 2 Dyadic Initialization In this case the translation and dialation parameters will be initialized using the dyadic grid method On the one hand the translation matrix m m having mj as its elements has Nw rows and Ni columns On the other hand the dilation matrix d d having d as its elements is also composed of Nw rows and Ni columns To be able to explain the steps used in the dyadic initialization algorithm we will use the dyadic grid shown in Figure 5 3 as an example As illustrated in Figure
95. Np AN uk oh u i e ae o S4 Then we compute the sum of square error SSE and the mean square error MSE for every iteration as stated below Computing the sum of square error SSE SSE sum sum E xE Computing the mean square error MSE for every iteration MSE loops SSE Np 3 BACKPROPAGATION ALGORITHM In this section we will be using equations 3 12 to 3 19 to be able to compute the parameters of A0 I for updating the components of the vector 0 The 9 Backpropagation Algorithm 174 vector AQ I can be defined as follows Ab I Aagi 1 A6 Aci 0 E y A0 L 1 24 Ami I Adi I The network parameter vector 0 consists of the components of the matrices Woi Won m and d Thus in order to update 0 every epoch using O44 Boia AO D we need to update the components of Woi Won m and d 3 1 Updating the parameters of Wo Let us first state the following equations for Ab 1 J Ab 1 eA a oD p Yap rama p 1 n 1 e x Dire E aant 0 25 p 1 n 1 We have O Bb 26 ops where the Kronecker s symbol delta defined as ng 1 for n k and ng 0 for n k Therefore equation 25 can be rewritten as Ab 1 x gt wt yAby L 1 27 3 Backpropagation Algorithm 175 Similarly let us define Aa 1 as follows OJ Aaj l E yAay l 1 p i u NS SOR TR UN n
96. PoP 9 H U aA DB gt ox X Y O oe oe de ge o oe Ow oo H xup 1 xdn 1 xup 2 xatyl xaty2 xdn 2 Appendix A Matlab Codes 106 yatxl yup 1 yatx2 yup 2 ydn 1 ydn 2 for k 1 2 SIf the elements are real isreal 1 otherwise isreal 0 nxyl k isreal xatyl k nxy2 k 7isreal xaty2 k nyx1 k isreal yatx1 k nyx2 k isreal yatx2 k end SReplace the imaginary values by twice the dimensions sof the square xatyl find xaty2 find yat xl find nyx1 yatx2 find Taking the x1 find xatyl lt xo Paking the xaty2 x2 find xaty2 lt xo Taking the yatxl yl find yatxl lt yo Taking the yatx2 y2 find yatx2 lt yo o LU Ae i o Ul Cs de c with in the range amp xatyl xo with in the range xaty2 gt xo with in the range amp yatxl yo with in the range yatx2 yo XO X XO XO lt X lt XO YOSYENO yOsysyo Setting initial val es to xad xb xc xd xa i xb i xc x1 xd x2 Setting initial values to ya yb yc yd ya yl yb y2 yc i yd i Ck CkCk ck ckck ck ckckck ck ckck ck ck ck ck kck ck ck ck ck kk ck kk k kk kk o Ae oe o A oe Evaluating xa and xb ya and yb CA Ck ck ck ck ockck ck ck ck ck ck ockockckockckckckockckck ck ckck ck kck ck kk kk oe Case Circle intersects yl at two different points if length 3x1 2 x
97. SCI1_OutChar Wait for buffer to be empty output 8 bit to serial port busy waiting synchronization Input 8 bit data to be transferred Output none extern void SCI1_OutChar char ES SCI1_OutUDec Output a 16 bit number in unsigned decimal format Input 16 bit number to be transferred Output none Variable format 1 5 digits with no space before or after extern void SCI1_OutUDec unsigned short SCI1_OutString Output String NULL termination busy waiting synchronization Input pointer to a NULL terminated string to be transferred Output none extern void SCIl_OutString char xpt Ed SCI1_OutUHex Output a 16 bit number in unsigned hexadecimal format Input 16 bit number to be transferred Output none Nariable format 1 to 4 digits with no space before or after extern void SCI1_OutUHex unsigned short Appendix D Microcontroller Code 208 IAANAAATAADAAAAIAA MA TELA SATA Sexo AT TAA AA SARA ALT I ETAT ETE AT ATT ALT kx kx Kx kx CkCkck ck ckck ck kck ck kck ck ck k ck ck ck ck ko k k k kk kk sell ec KKKKKKKKKKKKKKKKKKKKKKKKKKKKKK This module implements interrupt driven background communications using SCI1 a single interrupt service routine is used to service both incoming as well as outgoing data streams xx fw 02 05 x include lt mc9s12dp256 h gt derivative information x include lt string h gt
98. The Figure 2 1 A vibrating string at an instant of time the quantities shown are used in the derivation of the classical one dimensional Wave equation 15 quantities 7 and 72 are the tensions at the points P and Q on the string Both m and 75 are tangential to the curve of the string Assuming that there is only vertical motion of the string the horizontal components of the tensions at the points along the string must be equal Using the notation provided in Figure 2 1 we have the following relation T COS T cos ba T constant 2 3 There is a net vertical force that causes the vertical motion of the string which we find to be Faet Ta Sin 0 7 sin 614 2 4 By Newton s second law F ma this net force is equal to the mass pAz along the segment PQ times the acceleration of the string 0 u 0t Thus we can state the following 2 T Sin 0 T sin 0 pare 2 5 2 1 The Wave Equation 10 Dividing equation 2 5 by equation 2 3 gives pAr Pu tan 0 tan 0 an U9 an 01 T OF 2 6 Since tan 0 and tan 05 are the slopes of the curve of the string at z and z Az respec tively they can be written as tan 0 Es uz x and tan 0 cu uz x Ax where uz denotes the partial derivative of u with respect to x Substituting the values for tan 0 and tan 02 into equation 2 6 yields px u Us x Ax us x Bp 2 7 Dividing equatio
99. X D gt gt O O if rem 1_x dvx 40 1_x 1 dvx 1 else nx l x dvx nx end if rem l_y dvy 40 1 y 1 dvy 1 else ny l_y dvy ny end PSL ESOS PS3 PS4 d d d d Loa Loa Loa Loa Fat fopen inout txt 1 fid nx 1 dvx s 1 1 for sS ny for t dvy t 1 1 PS4 1 3 1 r PS3 i 3 r PS2 i J r xc i yc j PS1l i j j inout 6 3f 6 3f 12 6f 12 6f 12 6f 12 6fWMn inout fprintf fid end end fclose fid 151 Appendix A Matlab Codes oo oo oe oo oe oe oo oo oo oo oo oo oo oe oo oe oo oo oe oo oo oo oe oo oe oo oo oo oo oo oo oo oo oo oo oe oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oe oo oo oo oo oo oo oe oo oo oo oe o oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oe oo oo oo oo oo oo oo oo oo oo oe oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo Saving the input output simulated data with no gaps in the o o oe Je oe o oe oe oe oe oo oo oo o A o oe oe o o o N fy E o Ka Y n 0 KG DN x Y A B E EOR V S 0 x cd e poy H E O sz n 4 oO v A pa N p mm 5 gt O Q S al a E MD 0 a P 98 2 sl cn y H H ae oe oe
100. Zehnder interferometers MZI which are used for measuring mechanical vibrations at magnetic cores of power transformers 6 Fabry Perot interferometers are used extensively as versatile tools for fast and sensitive vibration analysis in harsh engi neering environments The sensitivity of these sensors is increased by increasing the length of the sensing area however such an approach causes the sensor to be affected by fluctuations Not only do these sensors suffer from limitations in signal demodu lation caused by phase ambiguity but the external disturbance aforementioned can also be observed as a phase drift that is often compensated in order to measure the dynamic parameters of the system 7 8 Furthermore Bragg gratings have a rela tively poor resolution and are difficult to be located and installed in the structure Introduction 4 7 The conventional Michelson interferometer based laser vibrometer suffer from two main drawbacks limited sensitivity to surface displacement detection and their intolerance to the presence of optical speckles in the light beams An abrupt change in the speckles can lead to a sudden degradation in the optical power reaching the photodetector and a misinterpretation of the diminished output 9 Nevertheless reflective optical proximity sensors offer comparable performance to their inductive and capacitive counterparts in terms of resolution and bandwidth In an optical sensor a source impinges l
101. _hat 2 x 3 old on rots Y tl 27 6873 7B abel x abel y abel P3 Y NK KO D U Fh igure 5 lot3 Y hat 1 Y hat 2 x 4 old on LOES Y 1 Y 2 2 4 E abel x abel E abel Y NK XC O 2 O Hh x y P4 igure 6 lot Y hat 1 LineStyle LineWidth 2 Color O 0 0 old on lot Y 1 LineWidth 2 Color 0 O 0 abel N_p abel x egend Network output Desired output HK KO DIO Mh igure 7 lot Y hat 2 LineStyle LineWidth 2 Color 0 0 0 old on lot Y 2 LineWidth 2 Color 0 O 0 abel N_p abel y egend Network output Desired output HK KO D S Mh figure 8 f find Y 1 0 handlevector 1 plot Y 2 1 f end x f 1 f end 1 LineWidth 2 Color 0 0 0 DisplayName P1 Desired Output hold on handlevector 2 plot Y_hat 2 f 1 f end x 1 f end 1 Marker LineStyle none Color 0 0 0 DisplayName P1 WN output abel y cm ylabel Normalized Power legend handlevector 1 2 x figure 9 handlevector 1 plot Y 2 f 1 f end x 1 f end 2 LineWidth 2 Color 0 0 0 DisplayName P2 Desired Output hold on handlevector 2 plot Y_hat 2 f 1 f end Marker o LineStyle none Color 0 x 1 f end 2 El 0
102. able x UnimplementedISR vector 63 reserved x UnimplementedISR vector 62 reserved x UnimplementedISR vector 61 reserved x UnimplementedISR vector 60 reserved x UnimplementedISR x vector 59 reserved x UnimplementedISR vector 58 reserved UnimplementedISR vector 57 PWM emergency shutdown UnimplementedISR vector 56 PORT P x UnimplementedISR vector 55 MSCANA transmit x UnimplementedISR x vector 54 MSCAN4 receive UnimplementedISR vector 53 SCANA errors x UnimplementedISR vector 52 MSCAN4 wakeup x UnimplementedISR vector 51 MSCAN3 transmit x UnimplementedISR vector 50 MSCAN3 receive x UnimplementedISR vector 49 MSCAN3 errors x UnimplementedISR vector 48 MSCAN3 wakeup x UnimplementedISR vector 47 MSCAN2 transmit UnimplementedISR vector 46 MSCAN2 receive UnimplementedISR vector 45 MSCAN2 errors x UnimplementedISR vector 44 MSCAN2 wakeup x UnimplementedISR x vector 43 MSCAN1 transmit x UnimplementedISR x vector 42 MSCAN1 receive UnimplementedISR vector 41 SCAN1 errors x UnimplementedISR vector 40 MSCAN1 wakeup x UnimplementedISR vector 39 MSCANO transmit x UnimplementedISR vector 38 MSCANO receive x UnimplementedISR vector 37 MSCANO errors x UnimplementedISR vector 36 MSCANO wake
103. ad 0 alphal alpha2 Power AAx BBx alpha2 alphal F Centre of circle less than or equal to xo elseif xn lt xo xo xn kx 2 W 2 xd 2 Q alpha exp kx sin alpha 2 alphal asin d r alpha2 pi alphal F quad Q alphal alpha2 Power AAx BBx alpha2 alphal F Centre of circle between 0 and xo right half of square elseif xn gt 0 amp xn lt xo d xo xn kx 2 W 2 d 2 Q alpha exp kx sin alpha 2 alphal asin d r alpha2 pi alphal F quad Q alphal alpha2 P1 AAx BBx alpha2 alphal F Power Pc P1 Centre of circle between xo and 0 left half of square elseif xn lt 0 amp xn xo d xo xn kx 2 W 2 d 2 Q alpha exp kx sin alpha 2 alphal asin d r alpha2 pi alphal F quad Q alphal alpha2 P1 AAx BBx alpha2 alphal F Power Pc P1 Centre of circle at the origin of the coordinate system elseif xn end Power Pc Appendix A Matlab Codes 126 SESCSSEEEEEEEEES ESE SSS SESE EEEEEEEEEEE SESE SSC SEEEEEEEEEEES ESS SSSSSS SESCS SEC EEEEEEEE SESE SSS SEC ESEEEEEEEEEE ESS SES SESEEEEEEEEESESSESSSSSSESS 525 Function to calculate the Power at the area of overlap 55 55 between circular beam spot and the square photocell 55 Center of circular beam spot is moving along the y axis SSS while the square photocell is fixed at the origin SSS 55 of the coordinate system
104. ale which ranges between ak i 1 and bk i 1 is to be divided dyadically that is in powers of 2 For the first level at L 1 Ax 1 The parameters n 1 and p 0 are then initialized to be used in the following while loop while pzbk i p ak 1 1 nxdiv M n p D n div n n 1 end p should be initialized to a value less than bk We exit the while loop once p bk i The output of the above while loop at L 1 can be stated as follows gt gt D 1 WN Initialization 160 D i 1 gt gt n n 3 The output of the while loop at L 2 can be stated as follows 0 5000 0 0 5000 1 0000 0 5000 0 5000 0 5000 0 5000 The output of the while loop at L 3 can be stated as follows 0 7500 0 5000 0 2500 0 0 2500 0 5000 0 7500 1 0000 1 WN Initialization 161 0 2500 0 2500 0 2500 0 2500 0 2500 0 2500 0 2500 0 2500 9 It can be realized that as L increments the size of the row vectors M and D increases by 2 The difference between the enteries of M is Ax which becomes smaller as L increases The elements of D are all equal to Az which depends on the value of L Next we enter into the following for loop for w 1 n 2 f 1 w L M 2xw 1 g 1 w L D 2xw 1 end The above loop generates two 3D arrays f and g In general the third dimen sion is numbered by pages Thus a 3D array has rows columns and pages Each page contains a 2D array of rows and
105. alization E 9 2 O o Input simulated data no gaps x inoutzero 3 inoutzero 4 inoutzero 5 inoutzero 6 Desired simulated data no gaps Y inoutzero 1 inoutzero 2 RP Input simulated data with gaps xe inout i 3 znouE 2 4 12nout 5 5 znmo E 6 5 Desired simulated data with gaps lt Ys inout 1 axnouE s 2 5 Input experimental data inoutexp 3 inoutexp 4 inoutexp 5 inoutexp 6 sired experimental data inoutexp 1 inoutexp 2 o o oe oe a K SApplying preprocessing condition on data nzil find x 1 20 x 2 40 x 3 40 x 4 0 for nil 1 length nzil x_newl nil x nzil nil Y_newl nil Y nzil nil se se end x x newl Input data after condition Y Y_newl Desired output data after condition tstr find Y 1 0 SInput data used for testing x test x tstr 1 tstr end Desired output data used for testing Y_test Y tstr 1 tstr end SInput data used for training x x 1 tstr 1 1 x tstr end 1 end 1 Desired output data used for training Appendix A Matlab Codes 139 Y Y 1 tstr 1 1 Y tstr end 1 end 1 Y Y u 0 01 Setting the learning rate gamma 1 u Setting the momentum coefficient Ax size x Ay size Y Np Ax 1 1 Sno Ni Ax 1 2 Sno N1 3 Sno Nw 2 N1 1 Sno No Ay 1 1 no I ones 1 Np of of of of of patterns inpu
106. am spot x coordinates of the intersection points between x the circular beam spot and the square photocell y coordinates of the intersection points between the circular beam spot and the square photocell x coordinate of the right side of the square photocell y coordinate of the upper side of the square photocell cornenrs of the square inside the circular beam spot the function Area of intersection between circle and square as circle moves along both the x and y axis o o AP oe o oe oe oe oe function Area AREAXY2 r xn yn xint yint xo yo Cc px py Ac Ca AGE els SCa if xn 0 amp yn SCa elseif xn 0 amp yn 0 SCa elseif xngz0 amp yn SCa isreal xi isreal yi pix r 2 se 1 No px 0 Area 0 eif pxx0 se 2 Cen Area Ac se 3 Cen Area fev se 4 Cen Area fev se 5 Cen nt nt Check if there is intersection x coordinate Check if there is intersection y coordinate Area of circle with radius r intersection between circle and square OR just touching py 0 length xint 1 se se amp py 0 ter of circle at the origin of the coordinate system ter of circle moving along the y axis only al AREAY2 r xn yn xint yint xo yo C ter of circle moving along the x axis only al AREAX2 r xn yn xint yint xo yo C ter of circle moving along bo
107. amp amp length number 10 length SCI1_OutChar character character SCI1_InChar if sign 1 return number else return number Appendix D Microcontroller Code 216 Er SCI1_InSLDec InSLDec accepts ASCII input in signed decimal format and converts to a 32 bit signed number valid range is 2 147 483 648 to 2 147 483 647 Input none Output 32 bit signed number If you enter a number outside 2147483648 it will truncate without an error Backspace will remove last digit typed signed long SCI1_InSLDec void signed long number 0 length 0 char sign 0 0 pos 1 neg char character character SCIl_InChar while character CR accepts until carriage return input The next lines checks for an optional sign character or and then that the input is a digit 0 9 If the character is not 0 9 it is ignored and not echoed if character SCI1_OutChar character else if character sign 1 SCI1_OutChar character else if character gt 0 amp amp character lt 9 this line overflows if above 4294967296 number 10 number character 0Q length SCI1_OutChar character If the input is a backspace then the return number is changed and a backspace is outputted to the screen else if character BS amp amp length number 10 le
108. and an output layer The input layer consists of neurons which accept external inputs to the network Inputs and outputs of the hidden layers are internal to the network and hence the term hidden Outputs of neurons in the output layer are the external outputs of the network Once the structure of the feedforward network has been decided that is the number of hidden layers and the number of nodes in each hidden layer has been set a mapping is learned by varying the connection weights w s and the biases b s so as to obtain the desired input output response for the network One method often used to vary the weights and biases is known as the backpropagation algorithm in which 3 3 Wavelet Transforms 34 the weights and biases are modified so as to minimize a cost function of the form E Y or yvlp zP yP eO where O is the output vector at the output layer of the network when x is applied at the input In this case wj denotes the weight applied to the output O of the jth neuron when connecting it to the input of the ith neuron and b is the bias input to the jth neuron Backpropagation employs gradient descent to minimize E That is the weights and biases are varied in accordance with the rules OE Au Wij ED and OE Feedforward neural networks are known to have empirically demonstrated ability to approximate complicated maps very well using the technique just described 3 3 WAVELET TRANSFORMS In this se
109. ar beam spot is equivalent to one sS filename H H n ui 0 B oe oe oe oe o oe oe oe o o o o o o oP o9 o oP o o oe oe oe oe o o o o o o o o9 o9 o oe oe oe oe o o o o o o o o A o o AP oe oe o oe o oe o oe oe oe o oe oe oe o oe oe oe o oe o oe o oe o oe o oe oe oe oe oe o oe oe oe o oe o oe o oe o oe o oe o oe oe oe oe oe oe oe o oe o oe o oe o oe o oe o oe o oe o oe o oe o oe oe oe o oe o oe o oe o oe o oe o oe o oe o oe Q fun E e ct MD ct y 0 w K 0 ge O Fh ct B 0 to overlap between beam spot and the square photocell f circular beam spot is moving along both the x is while the square photocell is fixed at the f the coordinate system Q w ide of the square photocell Y AREAXY2 m by Yasmine El Ashi Fall 2007 65 555 5 SEE EEEEEE SEES EEEEEE SESE EEEEEE SEE EEEEEEE SESE EEEESES CESSES SSSSSSSSSSSo SSS0 0 00 000000050000000000000000000 Be kK ck kk RR KK RRR KK KR KK KK KS Sk LE Lx LE Sx Sx Sx Sx Sx Sx Sx Lx LE Le Sx Sx o ok Eck ck ck ke KKK KKK KK KKK KKK ck ck ck ck KR KKK KKK KK KKK KR KKK KKK KKK KKK KKK KR KK KEK Input to r xn yn xint yint xO aU es Output of Area the function x radius of circular beam spot x coordinate of the center of the beam spot y coordinate of the center of the be
110. aracter lt f digit character a 0xA If the character is not 0 9 or A F it is ignored and not echoed if digit lt 0xF jA number number 0x10 digit length SCI1_OutChar character Backspace outputted and return value changed if a backspace is inputted else if character BS amp amp length number 0x10 length SCI1_OutChar character character SCI1_InChar Appendix D Microcontroller Code 218 return number ff SCI1_OutUHex Output a 16 bit number in unsigned hexadecimal format Input 16 bit number to be transferred Output none Variable format 1 to 4 digits with no space before or after void SCI1_OutUHex unsigned short number This function uses recursion to convert the number of if unspecified length as an ASCII string if number gt 0x10 SCI1_OutUHex number 0x10 SCI1_OutUHex number 0x10 else if number lt 0xA SCI1_OutChar number 0 else SCI1_OutChar number 0x0A A endif ERAS Ea Vita 219 VITA Yasmine Ahmed El Ashi was born on December 31 1984 in Khartoum Sudan She completed her IGCSE O level and A level examinations in Unity High School a missionary private secondary school in Khartoum in 2001 She earned a Bachelor of Science degree in Electrical Engineering with a MagnaCumlaude honor 3 8 GPA from the American University of Sharjah in
111. at p 0 on axis and decays monotonically as p increases The beam W z Diffracting Gaussian beam gt Z Beam waist at Beam minimum z y waist Figure 2 4 Gaussian beam model for the laser source used in the proposed system width W z of the Gaussian distribution increases with the axial distance On the beam axis p 0 the intensity Wo Io W z MPa Ta n 2 58 has its maximum value Jp at z 0 and drops gradually with increasing z reaching half its peak value at z 29 as shown in Figure 2 4 When z gt gt zo I 0 z Ipz z so that the intensity decreases with the distance in accordance with an inverse square law The overall peak intensity I 0 0 Jp occurs at the beam center z 0 p 0 2 3 Wavefronts 2r 0 9r 0 8r 0 7r 0 6r 0 5r 0 4F 0 3r 0 2F 0 1r Figure 2 5 The normalized Gaussian intensity profile 2 3 3 2 Power The total optical power carried by the beam is the integral of the optical intensity over a transverse plane say at a distance z P re z dA 2 59 A where dA pd0dp therefore the above integral can be evaluated as follows oo 2m f 1o oae 2m 1 p 2 pap s 0 Y I I SA 9 8 AA I p z 2npdp Il gt r1 s Na KK N bo gt o O ge a N Aw nn LLL nnb ha 7o 2 3 Wavefronts 28 By using a change of variables u o where du 2 pdp and in
112. ated data set at x 0 cm filename wavnet52 mse reverse simwithgaps divx0 05 divy0 02 testing m Q 2 Q 9 O O O D D O O O O O Q O O O D O O D O O 0 0 O O O O O O O O 9 O O O O O O O O O O O C O O O O O D O O O O O O O O O O O O o o o o o o 9 9 9 9 9 O O G O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O 9 O load MSE test RP simulated data gaps w gaussian N1 2 Nw 3 gamma 0 99 u 0_01 loops 10to5 testing_0 divx 0_05 divy 0_02 load RP simulated data gaps w gaussian N1 2 Nw 3 gamma 0_99 u 0_01 loops 10to5 testing_0 divx 0_05 divy 0_02 MSE train 1 MSE end MSE test 1 MSE_RPtest2 load MSE test RP simulated data gaps w gaussian N1 23 Nw 7 gamma 0 99 u 0_01 loops 10to5 testing_0 divx 0_05 divy 0_02 load RP simulated data gaps w gaussian N1 3 Nw 7 gamma 0_99 u 0 01 loops 10to5 testing 0 divx 0 05 divy 0 02 MSE_train 2 MSE end MSE_test 2 MSE_RPtest3 load MSE_test RP simulated data gaps w gaussian Nl1 4 Nw 15 gamma 0 99 u 0 01 loops 10to5 testing 0 divx 0 05 divy 0 02 load RP simulated data gaps w gaussian N1 4 Nw 15 gamma 0_99 u 0_ 01 loops 10to5 testing 0 divx 0_ 05 divy 0_02 MSE_train 3 MSE end MSE_test 3 MSE_RPtest4 load MSE test RP simulated data gaps w gaussian N1 5 Nw 31 gamma 0_99 u 0_01 loops 10to5 testing_0
113. ation 67 can be computed as follows Deltad Dd_aver gammaxDeltad_old The parameter of m and d are then updated as follows m m Deltam d d Deltad Then for the next epoch we have 9 Backpropagation Algorithm 189 De De tam old Deltam tad old Deltag After completing the desired number of epochs or iterations a plot of the MSE is generated as follows loglog MS xlabel Artati Iterations E ylabel MS grid on Appenndix C DAQ Code TTT TTT CTCL TCL ANSI C Example program Acq IntClk c Example Category AI Description This example demonstrates how to acquire a finite amount of data using the DAQ device s internal clock Instructions for Running Select the physical channel to correspond to where your signal is input on the DAQ device Enter the minimum and maximum voltages ds 2 Note EM 4 Steps 1 245 Sis YHA OB For better accuracy try to match the input range to the expected voltage level of the measured signal Select the number of samples to acquire Set the rate of the acquisition The rate should be AT LEAST twice as fast as the maximum frequency component of the signal being acquired Create a task Create an analog input voltage channel Set the rate for the sample clock Additionally define the samp le mode to be finite and set the number of samples to be Ca Read Call
114. ation and Ap plied Optimization Sharjah UAE January 20 22 2009 D Haddad P Juncar G Geneves and M Wakim Gaussian Beams and Spatial Modulation in Nanopositioning IEEE Transactions on In strumentation and Measurement Oct 2008 http www thorlabs com retrieved September 2008 Matlab Codes Appenndix A oe oo oo oo oe oo oo oo oo oo oo oo oo oe oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oe oo oo oo oo oo oo oo oo oo oo oo oo oo oe oo oo oo oo oo oo oo oe oo oo oo oo oo oo oo o oo oo oo o oe oo oo oo oo oo op oo oo oo oe oo oo oo oo oo oo oe oo oo oo oo oe oo oo oo oo oo op oo oo oo oo oo oe oo oo op oo oe oo oe oo oe oe oo oo oo oe oo oo oo oe oe oo oo oo oo oo oo oo oo oo Program to calculate the area of overlap between the o AP o9 oe oe o oP o9 o oe oo AP o9 o oe circular beam spot and the square photocell as the beam scans the plane of the photocell e o N 9 Ey G n af N rl N H a Q 0 4 S oO d E n n a gt zn ke E S 0 oO S Y 4 orl n y H ae oe oe ae oe oe o oe oe oo oo oe oo oe oe oo oo oo oo oo oo oo oe oo oo oo oo oo oo oo oo oo oo oe oo oo oo oo oo oo oo oo oo oo oo oo oe oo oo oo oo oo oo oo oo oe oo oo oo oo oo oo oo oo oo oo oe oo o
115. atyl 1 zxatyl 2 xa xatyl 1 xb xatyl 2 ya yl yb yl Case Upper and lower part of circle intersect yl Sat the same point elseif length jx1 2 2 amp xatyl 1 xatyl 2 jx1 3x1 1 xa xatyl 3x1 Case Circle intersects yl at one and only one point elseif length 3x1 xa xatyl 3x1 Case No intersetion between circle and yl elseif length 3x1 0 xa 1 xa i end Case Circle intersects y2 at two different points if length 3x2 2 amp xaty2 1 zxaty2 2 xa xaty2 1 Appendix A Matlab Codes 107 xb xaty2 2 ya y2 yb y2 Case Upper and lower part of circle intersect y2 sat the same point elseif length jx2 2 2 xaty2 1 xaty2 2 jx2 jx2 1 xb xaty2 3x2 Case Circle intersects y2 at one and only one point elseif length 3x2 xb xaty2 jx2 Case No intersetion between circle and y2 elseif length 3x2 0 xb i xb 1 end oe KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK o A oe 2 o Evaluating xc and xd yc and yd CC CK C Ck Ck Ck Ck Ck C CC SC S Ck Ck Sk Sk Sk Kk kx kx ko A A ko oe Case Circle intersects x1 at two different points if length jyl 2 yatxl 1 zyatxl 2 yc yatx1 1 yd yatxl1 2 xc x1 xd x1 Case Upper and lower part of circle intersect xl Sat the same point elseif length jyl 2 yatxl 1 yatx1 2 jyl jyl 1 yc yatxl jyl Case Circle intersects xl at one and only one point elseif len
116. blem of which approximation to use that is which approximating functions F w x would effectively represent the function f x 2 the problem of which algorithm to use for finding the optimal values of the parameters w for a given choice of F 3 the problem of an efficient implementation of the algorithm either through hardware or software or both 16 Most approximation schemes can be mapped into a certain network that can be dubbed as a neural network In general networks can be regarded as a graphic notation for a large class of algorithms In our discussion a network is a function represented by the composition of a number of basic functions To measure the quality of the approximation one introduces a distance func tion p to determine the distance p f x F w x of an approximation F w x from f x The distance is usually induced by a norm such as the standard L norm The approximation problem can then be stated formally as DEFINITION 2 1 f f x is a continuous function and F w x is an ap proximation function that depends continuously on w P and x the approximation problem is to determine the parameters w such that p F w x f 09 p F w x f x 3 1 for all w in the set P A solution of this problem if it exists is said to be a best approximation The existence of a best approximation depends ultimately on the class of functions 3 2 Neural networks 31 to whom F w x belongs 1
117. bs B 2 B 3 x1 0e 015 amp abs B 2 B 3 gt 0 C B 1 B C 2 1 xint C 1 yint C 2 elseif abs B 1 B 3 lt 1 0e 015 amp abs B 1 B 3 gt 0 C B 1 B 2 xint C 1 yint C 2 end elseif length n if n 1 1 B A 3 elseif n 1 B A 2 elseif length n 1 point of intersection f 10 sum n B A f xint B 1 yint B 2 end 2 points of intersection special case 3 Appendix A Matlab Codes 114 half area of circle inside square elseif p40 amp sum sum A B A 1 A 2 xint B 1 yint B 2 elseif pz0 4 points of intersection xint A 1 yint A 2 end oo Distance between cornerl xo yo and centre of circle D 1 sqrt xl xn s 2 yl yn t 2 Distance between corner2 xo yo and centre of circle D 2 sqrt x2 xn s 2 yl yn t 2 Distance between corner3 xo yo and centre of circle D 3 sqrt x2 xn s 2 y2 yn t 2 oo Distance between corner4 xo yo and centre of circle D 4 sqrt x1 xn s 2 y2 yn t 2 Corners of square inside the circle c find D lt r Wavelength of a He Ne laser source in cm lamda 6 33e 05 Spot size of the beam 2Wo 2 3cm to get 99 of Total power Wo 1 3 zo pixWo 2 1lamda SRayleigh range in cm z 0 SAxial distance z in cm Io 1 Maximum intens
118. ce in cm Spot size of the beam 2Wo 2 3cm to get 99 of Total Power Wo 1 3 zo pixWo 2 1amda SRayleigh range in cm z 0 SAxial distance z in cm Io 1 Maximum intensity value W Wox sqrt 1 z zo 2 Beam Width Il Iox Wo W 2 AA 11x W 2 2 BB exp 2 r 2 W 2 px isreal xint Check if there is intersection x coordinate se py isreal yint Check if there is intersection y coordinate Pc I1x 2xp1 W 2 2 1 BB SPower of spot with radius r Case 1 No intersection between circle and square OR just touching if px 0 amp py 0 length xint 1 Power 0 Appendix A Matlab Codes 127 elseif px40 amp pyx0 upper side of square if yn gt yo d yn yo ky 2 W 2 d 2 Q beta exp ky sin beta betal asin d r beta2 2pi betal F quad Q betal beta2 Power AAx 9 9 Case 3 lower side of square elseif yn lt yo yo yn ky 2 W 2 d 2 Q beta exp ky sin beta betal asin d r beta2 2pi betal F quad Q betal beta2 Power AAx Case 4 elseif yn 0 amp yn lt yo d yo yn ky 2 W 2 xd 2 Q beta exp ky sin beta betal asin d r beta2 2pi betal F quad Q betal beta2 P1 AAx BBx beta2 betal F Power Pc P1 Case 5 elseif yn lt 0 amp yn yo d yotyn ky 2 W 2 da 2 Q beta exp ky sin beta betal asin d r beta2 2pi betal F quad Q betal beta2 P1
119. cia Souto and H L Rivera Multichannel fiber optic interfero metric sensor for measurments of temperature and vibrations in composite materials IEEE Journal Selected Topics in Quantum Electronics vol 6 no 5 p 780 Sep Oct 2000 T K Gangopadhyay S Chakravorti S Chatterjee and K Bhattacharya Time frequency analysis of multiple fringe and nonsinusoidal signals ob tained from a fiber optic vibration sensor using an extrinsic fabry perot interferometer Journal of Lightwave Technology vol 24 no 5 pp 2122 2123 May 2006 C Wang S B Trivedi F Jin S Stepanov Z Chen J Khurgin P Rodriguez and N S Prasad Human life signs detection using high sensitivity pulsed laser vibrometer IEEE Sensors Journal vol 7 no 9 p 1370 Sep 2007 BIBLIOGRAPHY 103 10 13 14 15 16 17 18 19 22 23 24 A J Makynen J T Kostamovaara and R A Myllyla Displacement sensing resolution of position sensitive detectors in atmospheric turbu lence using retroreflected beam IEEE Transactions on Instrumentation and Measurement vol 46 no 5 pp 1133 1134 Oct 1997 J Jason H Nilsson B Arvidsson and A Larsson Experimental Study of an Intensity Modulated Fiber Optic Position Sensor with a Novel Read out System IEEE Sensors Journal vol 8 no 7 July 2008 L P Salles and D W de Lima Monteiro Designing the Response of an Optical
120. columns The for loop will exter minate once w n 2 However if n is an odd number as the case beforehand the for loop will implicitly stop at w f1oor n 2 Each page for both and g indicate the level L While at every page we have one row and w columns The columns of f at level L are equivalent to the odd numbered indices of row vector M Similarly the columns of g at level L are equivalent to the odd numbered indicies of row vector D The end result of and g for L 1 3 is as follows 1 WN Initialization 162 gt gt f f 1 0 0 0 0 f 2 0 5000 0 5000 0 0 3 0 7500 0 2500 0 2500 0 7500 gt gt g qeu 1 0 0 0 Gg i722 0 5000 0 5000 0 0 gis 0 2500 0 2500 0 2500 0 2500 A point to note is that just as all of the columns of a 2D array must have the same number of rows and vice versa all of the pages of a 3D array must have the same number of rows and columns Thus for the first level or first page it is easy to observe that 3 additional zeros have been appended to the original vector and for the second level or second page we have two additional zeros for both and g 1 WN Initialization 163 Next the matrices F and G are defined as follows F squeeze f G squeeze 9 If a 3D array is composed of a single row vector at every page the squeeze function will transform the row vectors of such a 3D array into column vectors of a 2 dimensional matrix Th
121. composition theory we are able to decompose any function f x L R using a family of functions obtained by dilating and translating a single mother wavelet 4 x In addition the preceding wavelet inversion theorem states that a function f can be decomposed as a weighted sum or integral of its frequency components as measured by w d m The wavelet inversion theorem involves two parameters namely the translation m and dialation d since the wavelet transform gives a measures of the frequency using the parameter d of f near the point x m 26 3 3 3 Wavelet bases and frames The continuous wavelet transform and its inverse transform are not directly imple mentable on digital computers In practice they have to be discretized 20 When the inverse wavelet transform in equation 3 4 is discretized into 3 6 some conditions are required so that this discrete version of the reconstruction of f holds The wavelet y x is derived from its mother wavelet v x by the following relation esto 0 757 0 3 7 3 3 Wavelet Transforms 38 where m and d are the discretized translation and dilation factors Let Q be a denumerable family of functions generated by w of the following form 1 gt x Q y 27i m ER dG ERtjEZY 3 8 yd dj which constitute an orthonormal basis of some functional space such as L R Usu ally a regular lattice d tmo
122. ction we shortly state some basic concepts about wavelet transforms which involve continuous wavelet transform and wavelet bases and frames that will be useful in understanding the construction and development of wavelet networks 3 3 1 The Continuous Wavelet Transform CWT Historically the continuous wavelet transform was the first studied wavelet transform To introduce the wavelet transform we assume that a wavelet function Y x is given that satisfies the following two requirements 1 v x is continuous and has exponential decay that is Y x Me C for some constants C and M 2 The integral of 4 is zero that is f x de 0 26 r2 An example of a suitable wavelet function is 4 1 re whose graph is given in Figure 3 3 In the following discussion we assume that 4 1 equals zero 3 3 Wavelet Transforms 35 outside some fixed interval A x x lt A which is a stronger condition than the first condition just given We are now ready to state the definition of the wavelet transform DEFINITION 2 2 Given a wavelet y satisfying the two requirements just given the wavelet transform of a function f L IR is a function w R R given 7 iones Ju i Oe gt ar 3 2 From the preceding definition it is not clear how to define the wavelet trans form at d 0 However the change of variables y x m d converts the wavelet transfrom into the followi
123. de ways The elimination or suppression of such Introduction 2 undesirable vibrations will result in a reduction in noise levels and improved work environment maintenance of high performance standards and production efficiency as well as prolonging the useful life of industrial machinery thus cutting down the costs and frequency of maintenance On the other hand there are useful forms of vibration which include those generated by devices used in physical therapy and medical applications vibrators used in industrial mixers part feeders and sorters and vibratory material removers such as drills and finishers For instance product alignment for industrial processing or grading can be carried out by means of vibratory conveyers or shakers 2 Over the past 50 years the speeds of operation of machinery have doubled and consequently vibration loads generated due to rotational excitation would have quadrupled if proper actions of design and control were not considered As vibra tion isolation and reduction techniques have become an integral part of machine design the need for accurate measurement and analysis of mechanical vibration has grown significantly 4 To accomplish this we should undergo a phase of monitoring and diagnostic testing of vibration which would require devices such as sensors and transducers signal conditioning and modification hardware such as filters ampli fiers analog digital conversion means and actuators s
124. dimensions 4 Define the following eDmy 1 1 E k xDmy k eDdy 1 1 E k Ddy k 5 where eDmy 1 1 eDmy and eDdy 1 1 eDdy are page vectors that can be stated as edmy pel dmy edmy pezdmy eDmy pE Dmyp 58 edmy pen dmy edmyN pe dmy 9 Backpropagation Algorithm 185 and eddy pe ddy eddy ue ddy eDdy l l Ex Ddyy 59 eddy pe ddy eddy pe ddy In this case u has been set to 1 to ensure convergence of the MSE 5 Next define the following page vectors No No 3 pe dmy gt nesddy 1 kel Ya dma De a ddu gt pe dmy gt pez ddy kel kel EDmye o QEDdy 5 60 Y pe dmy gt perddy kel k 1 No No Y nep dmy Y nep ddyg kel kel This is done using the following commands EDmy EDmy eDmy EDdy EDdy eDdy where EDmy and EDdy are fist initialized to zeros using EDmy zeros 1 1 Np EDdy zeros 1 1 Np After exiting the for loop k 1 No we set the page vectors Dm 3 1 EDmy Dd j 1i EDdy 9 Backpropagation Algorithm 186 where Dm j i Dm and Dd j i Ddj can be stated as 1 1 dmi dd 2 2 dmi dd dm dd Np Np dm dd When we exit the for loop j 1 Nw we would have constructed the 3D arrays Dm and Dd with N pages where each page consists of the matrices p dm p dm Dm p dm p dmx and dd Dd
125. dinates of the intersection points between Sx the circular beam spot and the square photocell Sx xO x coordinate of the right side of the square Sx photocell Sx yo y coordinate of the upper side of the square x Sx photocell Se c cornenrs of the square inside the circular Sx beam spot Sx Output of the function Sx Area Area of intersection between circle and square as circle moves along x axis eee ee ck ck ck ck ARK KA KA ck ke ck check ck RA KA KA RARA RRA A KA RAR R A KA KARA function Area AREAX2 r xn yn xint yint xo yo Cc px isreal xint Check if there is intersection x coordinate py isreal yint Check if there is intersection y coordinate se se Ac pi r 2 SArea of circle with radius r Case 1 No intersection between circle and square OR just touching if px 0 amp py 0 length xint 1 Area 0 elseif px40 amp pyx0 Case 2 Centre of circle greater than or equal to xo right most side of square if xn xo d xn xo alpha asin d r Area r 2 2 pi 2 xalpha sin 2xalpha Case 3 Centre of circle less than or equal to xo left most side of square elseif xn lt xo d xo xn alpha asin d r Area r 2 2 pi 2 xalpha sin 2xalpha Case 4 Centre of circle between 0 and xo right half of square elseif xn 0 amp xn xo d xo xn o 5 o KJ Appendix A Matlab Codes 117 alpha asin d r Al1 r 2 2
126. e oe oo oo oo oo oo oe oo oo oo oo oo oo oo oo oo oo oe oo oo oo oo oe oo oo oo o oo oo oo oo oo oo oo oo oo oo oo oo oe oo oo oo oo oe oo oo oo oe oo o oo oo oe oo oo oo oe oo oe oo oo oo oo oo oo oo oe oo oe oo oe oo oo oo oo oo oo oe oo oo oo oe oo oo oo oo oo oo oe oo oe oe oo oo oo oo oo oo oo oo oo oe oo oe oo oo oo oo oe oo oe oo oe oe oo oo oo oe oo oo oo oo oo oe oo oo oo oo oo oo oe oe oe x xk x x coordinate of the center of the beam spot radius of circular beam spot EZ Eck ck ck ke ck ck ck ck KK KK ck ck kc KK ck ck ck KARA ck ck ck ck KR KKK KKK KKK KKK KR KKK KKK RK KK KKK xn Input to the function oo oe o oe oe o oe kK kK xk xk X y coordinate of the center of the beam spot x coordinate of the first point of intersection y y value of upper or lower side of the I H 0 O se O amp o O dH lt a y Q 0 amp Oo 3 amp H O 30 O 4 nN p ll WH Il O S Q eu ps 3 x a 4 3 o ge E E e OK o o o oe oe oe x coordinate of the second point of intersection Eck ck ck ke KKK KKK KK KKK KKK KK KKK KKK ck ck ck RARA RARA ARA RARA ARA ck kk xdn oo circx y r xn yn 2 y yn 2 xn xup xdn tunction 2 y yn 2 xn sqrt r xup xdn sqrt r oe oo oo oo oe oo o oo o oe o o oo oo o
127. e 4 8 Quadcell array of photodetectors Furthermore the center of the beam has been simulated to move on the plane of photodetectors along the trajectory y x A plot of the optical power distribution for the four cells against x the x position of the beam center following the given trajectory can be shown in Figure 4 14 where e and are first set to zero As illustrated the beam occupies most of the active surface areas of photocells 1 and 3 and as it moves away from photocell 3 and into the vicinity of photocell 1 cells 2 and 4 start detecting a portion of the optical power All four cells will ideally detect equal powers when the centroid of the beam is at the origin of the plane Since the values for e and 6 are technically not equal to zero their effect on the overall power distribution was investigated 4 2 Theoretical Optical Acquisition Model 66 Normalized Power y cm x cm 0 9 0 8 0 7 0 6 0 5 04 03 0 2 0 1 Figure 4 9 The normalized power obtained by photocell 1 as the beam center scans the quadcell plane Normalized Power 0 9 0 8 0 7 0 6 0 5 0 4 0 3 0 2 0 1 Figure 4 10 The normalized power obtained by photocell 2 as the beam center scans the quadcell plane 4 2 Theoretical Optical Acquisition Model 67 Normalized Power y cm 0 9 0 8 0 7 0 6 0 5 0 4 0 3 0 2 0 1 Figure 4 11 The normalized power obta
128. e Je oe oe oe e Ae Ae oe oe oe o Ae o oe oe o 9 9 o o o o o o 2 9 o o o u 0 01 x test inoutexp 3 inoutexp 4 inoutexp 5 inoutexp 0 Y test inoutexp 1 inoutexp 2 nz2 find Y_test 1 0 55 for ni2 1 length nz2 x_2 ni2 x_test nz2 ni2 Y_2 ni2 Y_test nz2 ni2 end nz22 find Y_2 2 lt 0 4 for ni22 1 length nz22 x_22 ni22 x_2 nz22 n122 Y 22 ni22 2 Y 2 nz22 n122 end amp Y 2 2 5 0 4 nz3 find Y_test 1 0 for ni3 1 length nz3 x_3 ni3 x_test nz3 ni3 Y_3 ni3 Y_test nz3 ni3 end nz32 find Y 3 2 0 4 for ni32 1 length nz32 x_32 ni32 x 3 nz32 ni32 Y 32 ni32 Y_3 nz32 ni32 end 2 2 Y 3 2 gt 0 4 nz4 find Y test 1 0 55 for ni4 1 1length nz4 x_4 ni4 x_test nz4 ni4 Y_4 ni4 Y_test nz4 ni4 end nz42 find Y 4 2 lt 0 4 for ni42 1 length nz42 x_42 ni42 x_4 nz42 ni42 Y_42 ni42 Y_4 nz42 ni42 end x_test x_22 Y_test Y_22 amp Y 4 2 gt 0 4 5 2 N size x_test Np N 1 1 I ones 1 Np input tst I x test Appendix A Matlab Codes 149 z zeros Nw Ni Np phi zeros Nw Ni Np phi_p zeros Nw Ni Np PHI_p zeros Nw Ni Np Y_hat_tst zeros No Np E zeros No Np PHI ones 1 Nw Np for j 1 Nw for i 1 Ni zZ j i x_test 1 m 3 1 d 3 1 phi 3 1
129. e defined These are constructed as the product of N scalar wavelets Ni Ni z v 25 ves 3 11 i 1 i 1 Here zji i Mji dji and the array x is given by x 1 2 i nal Families of multidimensional wavelets generated according to this scheme have been shown to be frames of L RM 23 24 In this work we have selected v zj zye A as our scalar mother wavelet which satisfies condition 3 5 and in the 3 4 Wavelet Networks WN 41 Input nodes Hidden nodes Output nodes Figure 3 5 Function approximation using wavelet networks multidimensional case direct products of such scalar wavelets have been taken 3 4 3 WN Learning The learning algorithm for adjusting the parameters of the WN is based on a sample of input output pairs x yx x where yz x is the function to be approximated The WN training depends on minimizing the following cost function 0 PI jXX 3 12 where e y Y is the error between the kth target output y and the corre sponding wavelet network output j7 for training pattern p while N is the total number of elements in the training set All the parameters of the wavelet network to be adjusted are collected in a vector 0 bj Aki cj Mji dy The minimization is performed based on the gradient descent algorithm The partial derivative of the cost function with respect to 0 is poa a 3 13
130. e input is a digit 0 9 If the character is not 0 9 it is ignored and not echoed if character gt 0 amp amp character lt 9 this line overflows if above 65535 number 10xnumber character 0 length SCI1_OutChar character If the input is a backspace then the return number is changed and a backspace is outputted to the screen else if character BS amp amp length Appendix D Microcontroller Code 214 number 10 length SCI1_OutChar character character SCI1_InChar return number Jj tet SCI1_InULDec InULDec accepts ASCII input in unsigned decimal format and converts to a 32 bit unsigned number df valid range is 0 to 4 294 967 296 Input none Output 32 bit unsigned number If you enter a number above 4294967296 it will truncate without an error Backspace will remove last digit typed unsigned long SCI1 InULDec void unsigned long number 0 length 0 char character character SCIl1 InChar while character CR accepts until carriage return input The next line checks that the input is a digit 0 9 If the character is not 0 9 it is ignored and not echoed if character gt 0 amp amp character lt 9 this line overflows if above 4294967296 number 10 number character 0Q length SCI1_OutChar character If the input is a backspace then the
131. e vs y position of the center of the beam while setting the x position at 1 05 cm Plot of photocell output voltage vs y position of the center of the beam while setting the x position at 1 05 cm Plot of photocell output voltage vs y position of the center of the beam while setting the x position at 0 55 cm Plot of photocell output voltage vs y position of the center of the beam while setting the x position at 0 55 cm Plot of photocell output voltage vs y position of the center of the beam while setting the x position at cm Uncertainity region when initializing the position of the beam center Position detection system block diagram Wavelet network structure for the position detection problem Dyadic grid for wavelet network Initialization Plot of MSE vs Iterations for different values of N where the the oretical model without gaps is used for training the WN u 0 0001 y 0 9999 no preprocessing condition is applied on the data Plot of MSE vs Iterations for different values of N where the the oretical model without gaps is used for training the WN u 0 1 y 0 9 preprocessing condition in equation 5 5 applied on the data vil 70 TA 71 72 73 73 74 74 77 77 78 78 79 80 82 82 84 86 86 5 6 5 7 5 8 5 9 5 10 5 11 5 12 5 13 5 14 5 15 5
132. ed by the quadrants as the image spot moves over the detector surface Other analog position sensitive detectors that have been proposed by Maky nen Kostamovaara and Myllyla in 10 are the lateral effect photodiode LEP de tectors An LEP is a large area single element photodiode having uniform resistive layers with two wide edge contacts on both the anode and cathode The current carriers generated in the illuminated region are divided between the electrodes in Introduction 9 proportion to the distance of the current paths between the illuminated region and the electrodes The measurement field of the LEP is determined by the size of its active area and it detects the spot position irrespective of spot size or shape The achievable SNR and the resolution of the 4Q detector is better than that of the LEP However LEP provides far better accuracy in a typical outdoor environment because atmospheric turbulence induced spatially uncorrelated intensity fluctuations within the light spot which result from defocusing derange the measurement resolution of the 4Q receiver 10 Furthermore one of the established non contact lateral position sensing tech niques involve the use of a charge coupled device CCD camera The CCD sensor records the light intensity in each pixel by means of charge coupling where the charges are transferred to a second bank of photosites before analog to digital conversion is made In this case position measu
133. ell While a2 is the angle between the vertical axis crossing through the beam center and the second point of intersection Given that ag m 01 pila x xo sino and ps o po we can calculate the intersection area A by evaluating the following double integral az pala Ar f J o ar pi o a2 d a2 _ E a fee A ji la 4 24 4 T emy p f a 2 po sin a a1 po F sin o mper quu da 2 sin o a1 a2 2 Po Po 2 e LS PURO ER LUE e da 1 2 ji sino Q1 j 2 5 t 201 P sint ion alar 2 a 2 4 2 Theoretical Optical Acquisition Model 47 The term cot a cot o4 in the preceding integral can be reduced to the following COSA CcOsay cota cot ay sing g sina sin o4 cos o sin o3 COS oq sin o4 sin Q2 sin ay Q2 sin a1 Sina Since 2 T 04 hence o4 ag 04 1 04 20 7 and therefore cota cota Bnei 02 sin Q1 SIN Q2 sin 204 T sin o1 sin o sin 201 sina sin a 2sino4coso 2c0801 sino sinog sinas Since sin o sin o we can state that 2 cot coto Baku rr 4 4 sin Q1 Substituting equation 4 4 into equation 4 3 we have 2 2 Po pof 2 2 COS o A m 2a E 5 a 201 y Sin an rp po po m 201 sin 04 2 cos 01 2 2 2 A 7 2a sin 2a Therefore A can be stated as 02 Ay 2 r 2a
134. er converg ing behavior as the number of learning epochs increased as shown in Figure 5 6 In addition the inverse relation between the MSE values and the number of wavelons N is clearly evident where the MSE is decaying at a faster rate as N is increased As illustrated in Figure 5 6 after 100 000 iterations the MSE reached the values 1 86e 03 for N 3 1 22e 03 for Nu 7 7 92e 04 for N 15 and 5 94 04 for both N 63 and N 127 5 2 Training and Testing of Wavelet Network 86 4021 o N 127 x N 255 Q 0 42 10 10049 L 400418 qa MSE 0 417 8 10 0 416 10 400415 L 0 414 10 10 No of iterations Figure 5 4 Plot of MSE vs Iterations for different values of N where the theo retical model without gaps is used for training the WN u 0 0001 y 0 9999 no preprocessing condition is applied on the data N 15 N 127 w 1092 MSE 1093 No of iterations Figure 5 5 Plot of MSE vs Iterations for different values of N where the theoretical model without gaps is used for training the WN u 0 1 y 0 9 preprocessing condition in equation 5 5 applied on the data 5 2 Training and Testing of Wavelet Network 87 MSE No of iterations Figure 5 6 Plot of MSE vs Iterations for different values of N where the theoretical model without gaps is used for trainin
135. eration P is set back to P2phi j Next let us state the following block of code for 3 1 Nw for i 1 Ni EDmy zeros 1 1 Np EDdy zeros 1 1 Np for k 1 No p squeeze PHI_p j i Dmy k Woh k 5 d 3 1 p zz squeeze z j i Ddy k Dmy k zz eDmy 1 1 E k xu Dmy k eDdy 1 1 E k xu Ddy k EDmy EDmy teDmy EDdy EDdy eDdy end Dm 3 1 EDmy Dd j i EDdy end end At every kth iteration for k 1 2 No we do the following 1 Use the command p squeeze PHI p 3 i to transform the page vec tor ji into the column vector p 2 Define the row vector Dmy k Woh k 3 d j i p Dmmyy as stated below N Dmyk dy dmyz dmy se dmy R o OR 22 s Om 55 Om ji Om 55 O m ji d 52 D 36 3 Backpropagation Algorithm 184 3 Use the command zz squeeze z j i to transform the page vec tor Zj into a column vector zz Similarly let us define the row vector Ddy k Dmy k zz Ddyy as stated below Ddy ddy ddp ddyp day oj oj age 8j Od da Ody dj Ck a Ckj sse mede ge ji ji In the above equation the column vector zz has been transposed just to be consistent with the code since in Matlab programming if element by element multiplication is carried out between two vectors they must be of the same
136. erimental limitations on the power distribu tion accuracy were discussed and the discrepancies with the theoretical results were presented 1 Bibliography A J Makynen J T Kostamovaara and R A Myllyla A high resolution lateral displacement sensing method using active illumination of a cooperative target and a focused four quadrant position sensitive de tector IEEE Transactions on Instrumentation and Measurement vol 44 no 1 pp 46 47 Feb 1995 C W de Silva Vibration monitoring testing and instrumentation New York CRC Press 2007 K Z Tang K K Tan C W de Silva T H Lee K C Tan and S Y Soh Application of vibration sensing in monitoring and control of machined health IEEE ASME International Conference on Advanced Intelligent Mechatronics Proceedings pp 377 378 July 2001 J P Sebastia J A Lluch J R L Vizcaino and J S Bellon Vibration detector based on GMR sensors IEEE Transactions on Instrumentation and Measurement vol 58 no 3 p 707 March 2009 Y Shan J E Speich and K K Leang Low cost IR reflective sensors for submicrolevel position measurement and control IEEE ASME Trans Mechatronics vol 13 no 6 pp 700 701 Dec 2008 Z Zhang and X Bao Continuous and damped vibration detection based on fiber diversity detection sensor by rayleigh backscattering Journal of Lightwave Technology vol 26 no 7 p 832 April 2008 J A Gar
137. ers such as the number of points of intersection between the circular spot and the square cell Nini as well as the number of corners N of the square that lie within the circle were found Xo Xo Figure 4 2 Parameters definition for area A Next we derived the mathematical formulation necessary to obtain the closed form equations for the overlap area This will be divided into three categories 1 Finding the area of intersection while moving the beam along the x direction only 2 Finding the area of intersection while the beam is moved along the y direction only and finally 3 Finding the area of intersection as the beam is moved about the entire x y plane along any random path As shown in Figure 4 2 x y indicate the coordinates of the center of the circular spot with respect to the center of the square photodetector cell and xo yo represent the coordinates of the top right most corner of the photocell which in this 4 2 Theoretical Optical Acquisition Model 46 case zog 0 5 cm and yo 0 5 cm Let us first define the following parameters d X Xo 4 1 which is the horizontal distance between the spot center and the side at which the circular spot intersects the square In addition we have T Xo po sino sinas 4 2 where o4 is the angle between the vertical axis crossing through the center of the beam and the first intersection between the circular spot and the square photoc
138. es not stabilize void PLL Init void Fendif PLL H Appendix D Microcontroller Code 200 EAAAAAAIAASAAAA AAA ATACA MAA M pAlce ELTA TAA TAAL AT ALT I EIA RA DANS AAT T TKK IK IK I OR RI IO I IO ORI OR kok ck kck ck kok ck I OK IO OK I OK I OK boosts the CPU clock to 48 MHz FI RR RR kk IR IO IK I RR ke ke ke e ke ee x modified to make PLL Init depend on _ BUSCLOCK defined in pll h PLL now running at 48 MHz to be consistent with HCS12 Serial Monitor fw 07 04 include hidef h common defines and macros x include mc9s12dp256 h derivative information tinelude pll h macro _BUSCLOCK x fx x X PLLOInit kx ck x x d ke e e Set PLL clock to 48 MHz and switch 9S12 to run at this rate Inputs none Outputs none Errors will hang if PLL does not stabilize void PLL Init void ensure we re running the controller at an appropriate clock speed x if BUSCLOCK 24 amp amp _BUSCLOCK 4 error pll h BUSCLOCK has to be set to 4 MHz or 24 MHz fendif set PLL clock speed dif _BUSCLOCK 24 SYNR 0x05 PLLOSC 48 MHz felse SYNR 0x00 PLLOSC 8 MHz endif REFDV 0x00 PLLCLK 2 OSCCLK SYNR 1 REFDV 1 Values above give PLLCLK of 48 MHz with 4 MHz crystal OSCCLK is Crystal Clock Frequency E CLKSEL 0x00 xMeaning for CLKSEL Bit 7 PLLSEL 0 Keep usin
139. excitement at every big or small new finding made I hope they accept my apologies for any inconveniences or disappointments that I might have caused I am also particularly grateful to my parents for their continuous support Finally it is with pleasure that I express my appreciation to all my friends and colleagues who supported me and aided me in both the good and hard times xi Introduction There are numerous applications which require accurate noncontact position mea surements such as vibration monitoring as well as vibration measurement systems with frequencies ranging from fractions of Hz to kHz and amplitudes varying between nanometers to meters 1 Natural vibration is a manifestation of the oscillatory behavior in physical systems as a result of a repetitive interchange of two types of energy such as kinetic and potential energies among components in mechanical systems 2 Additional factors responsible for mechanical vibrations in machines components and systems involve unbalanced inertia bearing failure in rotating systems poor kinematic design resulting in a non rigid and non isolating structure component failure and operation outside prescribed load ratings 3 Such types of vibration are usually categorized as undesirable or harmful vibration which also include structural motions generated due to earthquakes noise generated by construction equipment and dynamic interactions between vehicles and bridges or gui
140. f beam center position as it scans the photocell s regions Region Ke y de dy Ri T gt Xo y gt Yo T Ya Y Vo Ra T lt Lo y gt Yo f To Y Yo Rs T lt To y lt Yo T To Y Yo f gt To Y lt Yo t Tto V Vo Rs T gt Xo Dey Yo Seo Y Y Re T gt To y Sy lt 0 SH ey yty Ry y lt Xo O lt y lt yo To Yo Y Rg ox Ej yo Ly lt 0 e To Wt Fig lt To Y lt Yo Z9 5 Y Yo Rio zo lt r lt 0 y lt yo Loe yY Yo Ry 0 z zo y Yo Lo xL Y Yo Hi lt 2 lt 0 y Yo Xod X Y yo Ri3 0 x xo 0 lt Y lt Yo o 2x Yo y Ria x lt xr lt 0 0 lt y lt yo To FT Yo Y Ris xrp lt xr lt 0 y lt y lt 0 xw 2 Yo y Rig O lt x lt zto y lt y lt 0 tp Yo y Table 4 1 Table showing the range of each region 4 2 Theoretical Optical Acquisition Model 63 To do this the plane for one photocell has been divided into 16 different regions as shown in Figure 4 7 The power is computed depending on the region where the center of the beam is located if x y Ri Ro R3 or Ry then The power of the shaded region is P Pry else if x y Rs Re R7 or Rg then Check the following if Ne 1 and Nin 2 then Check the following if d 40 and d 40 or d 4 0 and d 0 or d 0 and d 0 then P Po Poy else if d 0 a
141. following 2 pp2 B wm 1 2p P i f I linis exp Gh pdpdB 4 33 Ja das WO W z Provided that p2 3 po and p1 08 y yo sin B a similiar procedure as P can be adopted to evaluate the optical power P as follows Ba va Boo I f epic H aus id h i fy exp u d8 2 nj fy exp 4 exp dd d i W2 sin wfr 2 f 2 yw jo foo C Br 2 Br Ki E B p f exp 7 dp gt where 2 v2 u p2 po wi ge ae gif i m E EN gt P sn 8 W N sing J Therefore the optical power P for vertical motion can be stated as Ba Py kiK2 fo P1 f exp de dp 4 34 sin 3 4 2 Theoretical Optical Acquisition Model 57 where ky 2 y yo W Similarly we investigated how the optical power inter cepted by one photocell changes as the beam center moves along the y direction only This can be divided into six different cases if Case 7 y gt yo then dy y Yo ae BP sin amp and the power of the shaded region is P P else if Case 8 y yo then dy yo Y ay d B1 sin amp and the power of the shaded region is P P else if Case 9 0 y yo then dy Yo Y _oim 1fdy gsm 2 pie and the power of the shaded region is P Pr P else if Case 10 yo y lt 0 then dy y Yo ain l dy B1 sin amp PUE a y and the power of the shaded region is P Pr
142. for the position detection problem number as described earlier in Chapter 2 Batch processing is used in off line training of a total of N patterns The feed forward matrix equation for our WN shown in Figure 5 2 can be stated as follows T ZP pr Won 8 Wo P 5 1 jj where the vectors T P 1 PP pp P pel 5 1 Network Initialization 83 and T o oF OF e 5 6 0 The matrix W consists of the direct linear coefficients between the input and output layers by ai 012 013 Ga Wa 5 2 b gt G21 023 33 Q24 While the matrix Won consists of the weights Ck between the hidden and output layers Ciq Ci2 C13 gt CIN Won 5 3 C931 C22 C93 CON 5 1 NETWORK INITIALIZATION The initialization procedure adopted in this project is the one proposed by Zhang and Benveniste in 23 To initialize the dilation and translation pa rameters the input domain of the signal is divided into a dyadic grid of the form shown in Figure 5 3 This grid has its foundation on the use of the first derivative of the Gaussian wavelet and it is a non orthogonal grid since the support of the wavelet used at a given dilation is higher than the translation step at this dilation 19 The total number of wavelons available in the network depend on the selected number of levels different dilations N 2 ev 1 For the multi dimensional case we handle the dyadic decomposition method on each inpu
143. g OSCCLK until we are ready to switch to PLLCLK Bit 6 PSTP 0 Do not need to go to Pseudo Stop Mode Bit 5 SYSWAI 0 In wait mode system clocks stop But 4 ROAWAI 0 Do not reduce oscillator amplitude in wait mode Bit 3 PLLWAI 0 Do not turn off PLL in wait mode Bit 2 CWAI 0 Do not stop the core during wait mode Bit 1 RTIWAI 0 Do not stop the RTI in wait mode Bit 0 COPWAI 0 Do not stop the COP in wait mode x PLLCTL 0xD1 Meaning for PLLCTL Appendix D Microcontroller Code 201 Bit Yi CME 1 Clock monitor enabl reset if bad clock when set Bit 6 PLLON 1 PLL On bit Bit 5 AUTO 0 No automatic control of bandwidth manual through ACO But 4 ACO 1 1 for high bandwidth filter acquisition 0 for low tracking Bit 3 Not Used by 9s12c32 Bit 2 PRE 0 RTI stops during Pseudo Stop Mode Bit ly PCE 0 COP diabled during Pseudo STOP mode Bit 0 SCME 1 Crystal Clock Failure gt Self Clock mode NOT reset while CRGFLG amp 0x08 0 Wait for PLLCLK to stabilize CLKSEL_ PLLSEL 1 Switch to PLL clock Appendix D Microcontroller Code 202 EEE EN Aa V V P P L I T P P M PPPUuIMHTMHIHI H TIIUMM KKK IK I ko ck koc RI ORI IKI IORI OR ckok ck kck ck kck ck kck ck kck ckckok ck kckckckck ck ck ok ok xx In this header file we are using the input capture xx Bus Clock 24 MHz Prescale r 1 x ARKKARAKAKKARAKKRKARKKA ee ee ee ee
144. g the WN y 0 1 y 0 9 11 0 1 mmm 0 01 11 0 001 10326 No of iterations Figure 5 7 Plot of MSE vs Iterations for different values of u where the simulated data without gaps is used for training the wavelet network Nu 63 5 2 Training and Testing of Wavelet Network 88 To investigate the dependency of the MSE on u we first set N to 63 instead of 127 wavelons since both achieve the lowest MSE as shown in Figure 5 6 and to reduce the complexity of the network structure as well as run time of the code The WN is trained with 0 1 y 0 01 and y 0 001 As shown in Figure 5 7 the lowest MSE equal to 5 78e 04 was achieved at u 0 01 for 100 000 iterations It can be also observed that the slope of the MSE at u 0 001 is relatively similar to that at u 0 1 however it encounters a sudden change at iteration number 9800 thus becoming steeper and closely interluding the slope of the MSE at u 0 01 After 100 000 iterations the MSE reaches a value of 5 95e 04 for u 0 1 and a value of 5 81e 04 for u 0 001 To assess the performance of the WN the data set at x 0 cm has been removed from the training patterns and preserved as testing data In this case the theoretical model with vertical gap 6 0 3 cm and horizontal gap 0 1 cm has been used for training The resolution for the x position was set to 0 1 cm and that for the y position was set to 0 02 cm Figure 5 8 s
145. ght exhibits a high frequency re sponse up to about 1 MHz accurate and sensitive piezoelectric transducers cover a relatively small area and are difficult to electrically isolate making them unsuitable in applications surrounded by electrical and magnetic fields 6 In situations where physical contact between the sensor and the device is inaccessible and undesirable non contact type sensors provide a better option These sensors operate on capacitive inductive magnetic or optical principles For instance capacitive sensors have very high resolution d lt 0 01 nm however they are sensitive to changes in temperature humidity and surface irregularities Inductive sensors measure displacement by current induction when a ferrous or nonferrous metallic object passes through the electromagnetic field of a coil wound Such sensors also have relatively high resolution nanometer and good bandwidth tens of kilohertz with the added advantage of being immune to dirt water and lubricating oil Capacitive and inductive sensors are generally expensive and require special signal processing circuitry for operation 5 In the recent years optical non contact position sensors have received great attention owing to their immunity to electromagnetic interference resistance to cor rosion chemical inertness and light weight Such sensors include Fabry Perot inter ferometers fiber Bragg grating FBG arrays Michelson interferometers and Mach
146. gth 3y1 yc yatx1 jy1 Case No intersetion between circle and x1 elseif length 3y1 0 yc i yc i end oec Case Circle intersects x2 at two different points if length jy2 2 yatx2 1 zyatx2 2 yc yatx2 1 yd yatx2 2 XC x2 xd x2 Case Upper and lower part of circle intersect x2 Sat the same point elseif length jy2 2 yatx2 1 yatx2 2 jy2 3y2 1 yd yatx2 jy2 Case Circle intersects x2 at one and only one point elseif length jy2 yd yatx2 jy2 Case No intersetion between circle and xl elseif length jy2 0 yd i yd i oe Appendix A Matlab Codes 108 KKEKKKKKKKKKKKK KKK KKK KKK ckockckckckockckck kck ck ck ckck k ck ck ko kk oe oe x y coordinates of intersection points ACKCkCk ck kckck ckckck ck ck ck ck ck ck ck ck ck ck ck ck k ck k ck ck k ck ck k ck kk kkkk oe xint xa xb xc xd yint ya yb yc yd A xint yint p isreal A if p m n find A i if length n 4 No intersection B 1 1 1 1 yint B 2 elseif length n 3 points of intersection if n 1 1 B A 2 A 3 A 4 elseif n 1 2 B A 1 A 3 A 4 1 elseif n 1 3 B A 1 A 2 A 4 elseif n 1 4 B A 1 A 2 A 3 end xint B 1 yint B 2 if abs B 1 B C B 1 B 3 xint C 1 yint C 2 elseif abs B 2 B 3 lt 1 0e 015 amp abs B
147. hows the training error and the test error after training the network for 100 000 iterations for different values of N while keeping and y fixed at 0 01 and 0 99 respectively Generally in this regime the test error is relatively higher than the training error At the other extreme of too few hidden wavelons the network does not have enough parameters to fit the training data well and again the test error is high Thus we seek an intermediate number of wavelons where a low test error will be attained As can be seen in Figure 5 8 we have a minimum test MSE of 3 45e 03 at N 15 and the corresponding training MSE has a value of 2 82e 04 As demonstrated in Figures 5 9 and 5 10 a better match has been achieved between the WN test output y and the theoretical data than the WN test output which is slightly oscillating about the position x 0 cm In addition Figure 5 11 shows plots of the normalized optical power measured by the four photocells vs the theoretical data y and the WN test output y when scanning the beam center vertically along x 0 cm 5 2 Training and Testing of Wavelet Network 89 a MSE ain S MSE st 10 LLI 09 107 10 Y E TES CES HIS 2E SH Bi 1 TS A duri 1 t o dor rdi 10 10 10 10 No of Wavelons N Figure 5 8 Comparing the MSE values vs N after training the theoretical model with gaps and after testing for the theoretical data set at x 0 cm The res
148. ian intensity profile Introduction 6 Since only the optical power of each photodetector can be practically acquired we aim to find a relationship between the power distribution of the photodetector array and the position of the spot center through a theoretical and experimental model In our approach we account for the nonlinear transfer characteristics by using a wavelet network as a function approximation technique to estimate the x y position of the light spot center that corresponds to the acquired optical powers Therefore in order to achieve a more accurate system model and to depict a better comparison between the theoretical results and experimental measurements we take into consideration the circular shape and Gaussian intensity profile of the light spot in formulating the optical power equations These equations will be further used along with a developed algorithm to simulate the theoretical model of the proposed position detection system In addition system imperfections such as the gap separations between the photodetectors have been accounted for in the simulation and their effect on the optical power distribution is studied A potential application of our proposed system will be on vibration monitoring where the position information will be employed to obtain characteristics such as the amplitude frequency and speed of vibration The rest of the thesis report is organized as follows in Chapters 2 and 3 we give an over
149. icrocontroller Code 205 LMIMMb dMIMWWMlblllllllllllllfllfscil h V M M M M PM M M MMIPMMEL olMMMMM M NAS T4 filename ACkckck ck k ck ck ck ck ck k k kk kk k Seal shi KKKKKKKKKKKKKKKKKKKKKKKKKK Jonathan W Valvano 1 29 04 This example accompanies the books d Embedded Microcomputer Systems Real Time Interfacing Brooks Cole copyright c 2000 Introduction to Embedded Microcomputer Systems Motorola 6811 and 6812 Simulation Brooks Cole if copyright c 2002 Copyright 2004 by Jonathan W Valvano valvano mail utexas edu es You may use edit run or distribute this file ty as long as the above copyright notice remains Modified by EE345L students Charlie Gough amp amp Matt Hawk Modified by EE345M students Agustinus Darmawan Mingjie Qiu adapted to the Dragon12 board using SCI1 fw 07 04 define labels for baudrates necessary coz 115200 isn t a 16 bit number anymor fw 08 04 define BAUD_300 0 define BAUD_600 1 define BAUD_1200 2 define BAUD_2400 3 define BAUD_4800 4 define BAUD_9600 5 6 7 8 9 define BAUD 19200 define BAUD 38400 define BAUD_57600 define BAUD_115200 standard ASCII symbols define CR OxOD define LF 0x0A define BS 0x08 define ESC Ox1B define SP 0x20 define DEL Ox7F SCrl rnat Initialize Serial port SCI1 Input baudRate is tha baud rate in bits sec Output none extern void SCI1_Init
150. ight onto a target object and subsequently reflects off the object s surface which is then projected onto a detector The sensed intensity of the light reflected onto the photodiode is related to an object s distance from the photodetector Optical sensors are also relatively inexpensive unlike the capacitive and inductive sensors 5 One feature common to all of the previously mentioned non contact sensors is that they are capable of measuring displacement in the direction of the optical axis of the system To measure lateral displacement that is perpendicular to the optical axis a position sensitive detector PSD is usually used Makynen Kostamovaara and Myllyla presented in 1 a lateral displacement sensing method based on the idea of imaging an illuminated cooperative target on a four quadrant 4Q PSD This arrangement has the advantage of being capable of providing true lateral displacement instead of angular displacement in large working volume without calibration This is possible due to the unique property of a target focused 4Q detector in which the size of the measurement span is determined solely by the size of the cooperative target thus providing inherently accurate constant scaling that is independent of the target distance The 4Q detector consists of four photodiodes quadrants positioned symmetrically around the center of the sensor and separated by a narrow gap The position information is derived from the signals receiv
151. imer channel 2 x TICISR vector 09 Timer channel 1 x UnimplementedISR vector 08 Timer channel 0 x UnimplementedISR vector 07 Real Time Interrupt RTI UnimplementedISR vector 06 IRQ x UnimplementedISR vector 05 XIRO x UnimplementedISR vector 04 SWI UnimplementedISR vector 03 Unimplemented Instruction trap UnimplementedISR vector 02 COP failure resetx UnimplementedISR vector 01 Clock monitor fail reset x Startup vector 00 Reset vector x Hh Appendix D Microcontroller Code 199 IIA AAA MAL IA III ILLIA RATA AI II P PM Pl 4 Y ML L MI III III III KKK IK IK IK OR AAA RARA kckckckok ck kck ck kok ck kck ck kok ck ckck ck k OK I OK boosts the CPU clock to 48 MHz kk ok koe Sk ke Sk ke kk kk Sk kk kk kk kk kk Sk ke Sk ke kk kk kk ke koc kk kk kk kk kk ke ke ke ke ke ke ke ee x f modified to define BUSCLOCK PLL now running at 48 MHz to be consistent with HCS12 Serial Monitor fw 07 04 ifndef PPL H define _PLL_H_ x Define the desired bus clock frequency no PLL crystal gt SYSCLOCK 4 MHz gt BUSCLOCK 2 MHz PLL on gt SYSCLOCK 48 MHz gt BUSCLOCK 24 MHz This is used by sci0 c and or scil c to determine the baud rate divider x define BUSCLOCK 24 fcx x x x PLLOInit xk x x x KKK Set PLL clock to 48 MHz and switch 9S12 to run at this rate Inputs none Outputs none Errors will hang if PLL do
152. imilarly we will define phi p ya 3D array with N pages where each page constitutes of the matrix sp p p p Pi Pra ccc Qu c AN sp D p P Por Pa cn Pa cc Pan SpA m P p P p Ci Pia 0 Vj co Pin Pp 5p d P eo pr CN VN 2 PNwi NN Each element Ps is represented by the following equation 0 zs pi Az 6n 1 exp i 21 ji 2 Feedforward Algorithm 172 To batchly compute the elements of the 3D array the following page vector will be defined Pri 5 l Zji Ly Pji z Zji Zji 1 exp 45 L 22 Pai N P The line of code used to compute phi p fps is as follows phi p j i z j i 2 1 exp 0 5 z 3 i 2 Next let us define the page vector which can be evaluated as follows 1 v 2 vj E Ni P A I Pin SPiL Pj ji DiN 23 o n 1 Q5 Jj Equation 23 can be computed using the following code PHI 15 9 RP ds APA o where PHI 1 j 9 After constructing the 3D array the command PHI squeeze PHI is used to transform the 3D array into the 2 dimen sional matrix that will be used to compute Y_hat Y as follows Y_hat Woh PHI Woixinput where input I The error E Y Y between the wavelet network output Y and the desired output Y is evaluated as follows 9 Backpropagation Algorithm 178 E Y Y hat where E E E Ex En and the row vector Ex el e2 nm a eee el z A
153. inate of the upper side of the square x Sx photocell Se c cornenrs of the square inside the circular Sx beam spot Sx Output of the function Sx Power Power at the area of intersection between Sx circlular beam spot and square photocell as the Sx beam spot moves along x axis BK KK KK ck ke RRA KA ck ck ke RAR RA KA KARA RAR RA KA KARA KK KK KKK KKS function Power POWERX2 r xn yn xint yint xo yo c lamda 6 33e 05 Wavelength of a He Ne laser source in cm Spot size of the beam 2Wo 2 3cm to get 99 of Total Power Wo 1 3 zo pixWo 2 1amda SRayleigh range in cm z 0 SAxial distance z in cm Io 1 Maximum intensity value W Wox sqrt 1 z zo 2 Beam Width Il Iox Wo W 2 AA 11x W 2 2 BB exp 2 r 2 W 2 px isreal xint Check if there is intersection x coordinate se py isreal yint Check if there is intersection y coordinate Pc I1x 2xp1 W 2 2 1 BB SPower of spot with radius r Case 1 No intersection between circle and square OR just touching if px 0 amp py 0 length xint 1 Power 0 Appendix A Matlab Codes 125 elseif px40 amp pyx0 Centre of circle greater than or equal to xo right most side of square if xn gt xo 9 9 Case 4 Case 5 SCase 6 end Case 3 left most side of square d xn xo kx 2 W 2 xd 2 Q 0 alpha exp kx sin alpha 2 alphal asin d r alpha2 pi alphal F qu
154. ined by photocell 3 as the beam center scans the quadcell plane Normalized Power 0 9 Figure 4 12 The normalized power obtained by photocell 4 as the beam center scans the quadcell plane 4 2 Theoretical Optical Acquisition Model 68 Figure 4 13 Quadcell arrangement for the experimental setup showing different e and 1 T T j T y T M 1 f V 8 e 0cm 0 9 d D i ud 6 0dcm H rA 4 Hn po 6 c 0 2cm T 0 8 A N di i 8 I 1 n 1 y M Pi we 0 7F 1 1 ry it 1 I 5 Photocell 3 Ti it Photocell 1 L os 1 it i 3 HM 1 NN eee EE 1 I de oO 1 IT l T 9 0 5 r M J iN 1 1 E Y ft M ES 5 04 x 44 it y Z 1 4 V 1 1 E 0 3 Api a E E 1 H Vy 0 2 Ru A ju J a Photocells Un X 2and4 1 0 1 H gu VEAN ve 7 1 1 fin 4 Y EN S 0 MA 2 1 5 1 0 5 0 0 5 1 1 5 2 Figure 4 14 Variation of the optical power detected by all four photodetectors as the beam is moved along y z line for different va
155. ion to overlap between circular beam spot and the square photocell Center of circular beam spot is moving along the x axis while the square photocell is fixed at the origin of the coordinate system Given diameter of the circular beam spot is equivalent to one side of the square photocell o o o o o A o o o o o o oe oe o o o o o o o9 o AL AL AP AL oe oe AP o o9 o9 o o AL o AL AL AL AY AY oe 1 8 T filename AREAX2 m Written by Yasmine El Ashi Fall 2007 0 0000000000000000000000000000000000000000000000000000000000 SESESEEEEEEEEESEEEEEEEESEEEESEEEESEEEESEEEEESEEEESEEEESEEEESS fE A E N SE E O S gt al bas oa Sak al a Sal E ual al a a al al Sa a a a al ad a al a al a a al al al al al al a a a alo al al ao al oa al ooo a ooo N E N SS SSSSSS5SSSSo o oo000000005005050500000000000000000005050000 Sk kk ke ke coke ok ok ck ck ck ck ck kk ke ke check ck ck ck ck ck ck ck kk ck check cock ck ck ck ck ck ck ck KAR RRA ee ee eae ck ck 5 x Input to the function Sx r radius of circular beam spot Sx xn x coordinate of the center of the beam spot Sx yn y coordinate of the center of the beam spot Sx xint x coordinates of the intersection points between Sx the circular beam spot and the square photocell Sx yint y coor
156. ion with Wavelet Networks 3 1 Function Approximation amp 22 kc x66 9o m n 3 2 Neural networks ens 3 3 Wavelet Transforms 3 83 1 The Continuous Wavelet Transform CWT 3 3 2 Inverse Wavelet Transform 3 3 3 Wavelet bases and frames 3 4 Wavelet Networks WN 3 4 1 Adaptive Discretization 3 4 2 Wavelet Network Structure sg WN Learning 2 6 ae See eee Ra awe Bo lv Contents iii vi xi 4 Optical System Modeling and Design 4 1 System Architecture amp a soe o4 6 0 Cede R RO RSS RR A REA 4 2 Theoretical Optical Acquisition Model 4 2 1 Modeling Optical Apodization 4 2 3 Modeling System Imperfections 4 3 Experimental Study of the Position Detector 4 3 1 Experimental Setup c uc R ox wade eR ee wy os 4 3 2 Optical Model Validation 00 5 Position Detection using Wavelet Network 5 1 Network Initialization se x pk eae ea eed ee wa doe o 5 2 Training and Testing of Wavelet Network 5a Vibration Monitoring p ao bone ok eee ed ORE ES 6 Conclusions Bibliography Appendix A Matlab Codes Appendix B User Manual for Wavelet Network Code 1 AWS hitialization eS ERE poROE EGO e Shee Y a 1 1 Initializing Won and Woi ax Sore oh ee X Nox e x es 1 2 Dyadic Initialization 64 64262 dba RR 2 Feedforward Algorithm
157. is the velocity at which a fixed phase point on the wave travels 5 arg U r constant 0 d On ft 7H mft kz dz 2 Tf T 0 2 kup 0 ESEE O See 2 3 Wavefronts 20 Furthermore the wavelength A is defined as the distance between two successive maxima or minima or any other reference points on the wave at a fixed instant of time Thus we can deduce the following wt kz wt k z A 27 kX 2m 2m A PE Since L 2 Up the wavelength A can also be stated as A 2m 2m v 2mUV _ Up wW 2r f f k VU Aum e f 2 3 2 Paraxial Waves A paraxial wave is a plane wave U r A r exp jkz with k 27 and wavelength A modulated by a complex envelope A r that is a slowly varying function of position The envelope is assumed to be approximately constant within a neighborhood of size so that the wave locally underlies plane wave nature Since the change of the phase arg A x y z is small within the distance of a wavelength the planar wavefronts kz 2mq of the carrier plane wave bend only slightly so that their normals are paraxial rays 13 For the paraxial wave to satisfy the Helmholtz equation the complex envelope A r must satisfy another partial differential equation obtained by substituting U r A r exp jkz into equation 2 29 The assumption that A r varies slowly with respect to z signifies that within a distance Az A
158. ity value W Wo xsqrt 1 z zo 2 Beam Width I1 I0x Wo W 2 AA Il1 W 2 2 BB exp 2 r 2 W 2 Pc Il 2xpi W 2 2 1 BB SPower of spot with radius r PT 0 5 Io pi Wo 2 sTotal Power of the beam Power feval POWERXY2 r xn s yn t xint yint xo yo c power s t Power Pc end end Plot of Normalized Power vs position of beam spot center along xy directions figure mesh xn yn power xlabel xn ocm ylabel yn cm zlabel Normalized Power 115 Appendix A Matlab Codes oe oo oo oo oe oo oe oo oo oo oo oo oo oe oo oo oo oe oo oo oo oo oo oo oe oo oe oo oe oo oo oo oo oo oo oe oo oe oo oe oo oo oo oo oe oo oo oo oe o oo oo oo oo oo oo oo oe oe oe oo oo oo oo oo oe oo oe oo oe oo oe oo oo oo oo oe oo oo oo oe oo oe oo oo oo oo oe oo oe oo oe oe oe oo oo oo oo oo oo oe oo oe oo oe oo oo oo oo oe oo oe oo oe oe oo oo oo oo oo oo oo oo oo oe oo oo oo oo oo oo oo Function to calculate x coordinates of the intersection 55 points between the circular beam spot and the upper or lower side of the square photocell ooo 767676 o o oe oe oe o oe o oe oe o o o oe oe co Oo N H fy G n Re E E 0 en a d oO E y n H U pal ll gt Q 0 E a 0 e D 0 Pp 2 m H 4 H z ae oe oe o oe oe o oe o
159. ive beam area intercepted by the different PDs Thus the optical power distribution of the photodetector array depends on the 2 dimensional position of the spot center The design problem at hand involves three major parts as demonstrated in Figure 4 1 The first part the optical acquisition system is concerned with acquiring the optical power distribution P P P Pp of the array of n photodetector cells Next the optical power information is fed into a lateral position detection system In this stage a WN is used as a function approximation technique to yield an 4 2 Theoretical Optical Acquisition Model 44 estimate P t and y P t of both x P t and y P t the Cartesian coordinates of the center of the light spot that correspond to the acquired optical power distribution The final stage uses the estimated position of the light spot for vibration monitoring In this research we focus on the first two stages of the proposed system M Photocell Array aw Optical Signal Acquisition i Position Detection System Laser Source Vibration Platform x Mirror Laser Beam y Vibration Monitoring System Gaussian Intensity Profile Figure 4 1 Hardware architecture of the proposed position detection system 4 2 THEORETICAL OPTICAL ACQUISITION MODEL The theoretical model evaluates the optical power distribution as the center of the
160. k DAQmxCreateTask amp taskHandle DAQmxErrChk DAQmxCreateAIVoltageChan taskHandle Dev2 ai0 Dev2 ail Dev2 ai2 Dev2 ai3 DAQmx Val Diff 5 0 5 0 DAQmx Val Volts NULL J Kk kk ck kk ck kk ck IK OK OK OK OK OK RK OR ck ck RARA RRA ck DAQmx Configure Code Writing Digital fk kckeck ckckeckckockeckckockckckckckckckckckckckckckckckckckck ckckckokckckckckock kckckckck ck k f DAOmxErrChk DAQmxCreateTask amp task DAQmxErrChk DAQmxCreateDOChan task Dev2 port0 line0 7 DAQmx Val ChanForAllLines f kckokckckockeckockockckckckckckckckckckckckckckckckckckckckck ckckckckckckckckckckckckckck ck k f DAQmx Start Code Writing Digital J kk kk ck kk ck kk ck koe ck kk ck OK ARK ARK ARK ARK ARK ARK ck ckckckck ok DAQmxErrChk DAQmxStartTask task fk kockeck ckockeckckockeckckockckckckckckckckokckckckckckckckckck ckckckckckckckckckckckckckck RAS DAQmx Start Code Voltage Acquisition J Kk KK IK OK KK OK OK OK OK ck ckokckckck ck ckck okck ck k Y DAOmxErrChk DAQmxStartTask taskHandle J Kk kk ck kk ck kk ck Kock Ck koe ck kk ck OK OOK RKO KK ck ckck ck Create and open file PD txt J Kk Kk Ck kk ck kk ck Kk ck koe ck koe ck OK IO RK ROK OK OK ck ck ck f fin fopen PD txt w KKK KKK KK KKK KK KEK k ck ockckckckckckckckckckckok ckckokckckckckckck kckckckck RR DAQmx Read Code and Write code Jk KKK IK OK KK OK OK OK ARK KK OK ckckock ck Setting Duty cycle to 50 114 counts via
161. kHandle Appendix C DAQ Code 193 if task 0 TKK KKK RK RK RK RK KK ORK ORK RK OR RRA RARAS DAQmx Stop Code Writing function KKK KKK KK KEK KKK KEK ckckckckckckckckckckck ck okckckokckckckckck kckck kck RS DAQmxStopTask task DAQmxClearTask task if DAOmxFailed error printf DAOmx Error s n errBuff printf End of program press Enter key to quit n getchar return 0 Appenndix D Microcontroller Code MIB MIB 7ZMIMISMMIIKffffffma n ce VMVMMMMMMPMIE IIEEMMMMLWM ll M dl T finclude mc9s12dg256 h Derivative information include lcd h LCD header x tinelude tZi h Input Capture header x include pll h Defines _BUSCLOCK sets bus finelude scil h frequency to _BUSCLOCK MHz x pragma LINK_INFO DERIVATIVE mc9s12dg256b void show_result void Show_result function prototype III Ml llllllllll Declarations VV V M M MM M M MM ML Mb d char x y MIB gU MPIlllll PWM _Initialization PWMCTL PWM Control Register 4 CONxy 0 Concatenation Disabled 8 bit PWM PSWAI 0 Continue while in wait mode PFRZ 0 PWM will continue while in freeze mode PWMPOL PWM Polarity Register PPOL1 1 PWM channel 1 is high at the beginning PWMPRCLK PWM Prescale Clock Select Register Ed PCKA2 0 Clock A No Prescaler Divisio
162. lues of e and 4 3 Experimental Study of the Position Detector 69 Another simulation has been run when e 6 0 1 cm and 0 2 cm As shown in Figure 4 14 the maximas of the normalized power waveforms for the first and third photocells shifted to their new center positions at 0 55 0 55 and 0 55 0 55 for e 0 1 cm and at 0 6 0 6 and 0 6 0 6 for e 6 0 2 cm In addition the power at the origin drops exponentially as e and become larger This effect has been demonstrated in Figure 4 15 The value for e was varied from 0 to 0 9 cm in steps of 0 1 cm The normalized power at one of the photocells has a maximum value of 0 25 at e 0 cm With a spacing of 0 1 cm the power at the origin of the plane dropped by 42 096 from its maximum value For e 6 0 2 cm we have a 70 4 power drop In the previous discussion e and 6 were equal however the design of the exper imental setup inevitably defies such an assumption As shown in Figure 4 13 the photocells are placed on a metallic plate with substrates of size 1 1 cmx1 3 cm The spacing between them is 1 mm Thorlabs FDS1010 photodiodes have been used where the Si detector is mounted on a 0 45 x0 52 1 1 cmx1 3 cm ceramic wafer with an anode and a cathode The active area for the FDS1010 is about 9 7 mmx9 7 mm 33 Taking into account the width of the inactive region of the photocell would add an extra 0 2 cm to the vertical spacing between the phot
163. m where the beam center is passed entirely along the metallic gap Moreover imperfections in the horizontal alignment of the quad cell detector plane and slight asymmetry around the center of the sensor at the receiver optics can be additional sources of error Position Detection using Wavelet Network The proposed position detection system is based on a wavelet network As shown in Figure 5 1 the vector P is input to the network and the output is an estimated position vector Y which is compared to the desired position vector Y Accordingly the error between them is used to retune the WN in order to achieve a better match In this chapter we report the results obtained from training the developed WN using theoretical model with and without gaps and using the experimental data for testing A Matlab code was built to run the WN training and testing In order to detect the position of the center of the laser beam the WN acts as a function approximation tool where its outputs 2 and jj are estimates of the desired positions x and y while the corresponding power distribution obtained from the quadcell P PP PP P PP are input to the network The preceding superscript p represents the training pattern Position Detection using Wavelet Network 82 Position Detection System Figure 5 1 Position detection system block diagram Input nodes Hidden nodes Output nodes Figure 5 2 Wavelet network structure
164. milar to the wave function u r t the complex wavefunction U r t must also satisfy the wave equation 1 0 U 2 2 2 Complex Amplitude Equation 2 25 can be written in the following form U r t U r exp 327 ft 2 26 Where the time independent factor U r a r exp jp r is referred to as the com plex amplitude The wavefunction u r t is therefore related to the complex ampli 2 2 Monochromatic waves 15 tude by u r t Re U r t Re U r exp j27ft U r exp 527 ft U r exp j2m ft 2 27 At a given position r the complex amplitude U r is a complex variable as shown Figure 2 2 Representation of a monochromatic wave at a fixed position r a the wavefunction u t is a harmonic function of time b the complex amplitude U aexp jp is a fixed phasor c the complex wavefunction U t U exp j27ft is a phasor rotating with angular velocity w 27 f radians s 13 in Figure 2 2 b whose magnitude U r a r is the amplitude of the wave and whose arg U r y r is the phase The complex wavefunction is represented graphically by a phasor rotating with angular velocity w 27f radians s Figure 2 2 c Its initial value at t 0 is the complex amplitude U r 13 2 2 8 The Helmholtz Equation If we substitute U r t U r exp 327 ft into equation 2 25 we get Lea 2 j 2T V U r e qe es 2 OR OF p e p 0 2 28 2 2 Monochr
165. n 2 7 by Az and setting the limit Az 0 zc Ug doe wem or ai Ax TOR due 00 Ox TOP Ou pu QS RO 2 Ox rot 2 8 And so equation 2 7 becomes u 18u A Rl ee 2 9 r v at a in the limit Az 0 where v r p P has units of speed 15 Its extension to more spatial variables is given by o u o u Qu 18u dx Oy O2 22007 1 9 u Although equations for the propagation of electromagnetic waves are likely to be similar to those for acoustic waves there is an important distinction between 2 1 The Wave Equation 11 the two Acoustic wave equations describe the propagation of a scalar quantity electromagnetic wave equations describe the propagation of electric and magnetic fields which are vectorial In order to derive the equations that describe the propagation of electromag netic waves we begin with Maxwell s equations OB VxE 0 2 11 OD V D p 2 13 V B 0 2 14 Where E D H B j are respectively the electric field electric displacement magnetic field magnetic induction and current density vectors To demonstrate the symmetry between the effects of electricity and magnetism for each equation describing the effects of the electric field there is a counterpart describing effects of the magnetic field Even the electric charges fit into the symmetric picture when a term for electric charge or electric current is present in one equation a zero term is present in it
166. n Th if PCKA1 0 Clock A No Prescaler Division T4 PCKAO 0 Clock A No Prescaler Division da PWMCLK PWM Clock Select Register fy T4 PCLK1 1 Clock SA is the clock source for PWM CH1 PWMSCLA P Scale A Register PWMCAE P Center Align Enable Register hit CAE1 0 CH1 operates in Left Aligned Output Mode PWMPER1 PWM Channel 1 Period Register PWMDTY1 PWM Channel 1 Duty Register PWME PWM Enable Register fy PWME1 1 Pulse Width channel 1 is enabled EE AE ENANA ANNA AE NAO Appendix D Microcontroller Code 195 void init PWM void PWM signal is generated at PPO Motor X and PP1 Motor Y pins DDRB 0x00 y PORTB x y OxFA PWMCTL 0x00 x8 bit modex PWMPOL OxFF xHigh polarity modex PWMPRCLK 0x04 PWMCLK 0x03 clock source is clock SA PWMSCLA 10 PWMCAE 0x00 output is left aligned PWMPERO 225 PWM freq 330Hz PWMPER1 225 PWM freq 330Hz PWMDTYO 0 Duty cycle is 50 of the CW direction PWMDTY1 0 Duty cycle is 50 of the CW direction PWME 0x03 Enable PWM channel 0 and channel 1 LEM MB MI AAA III IIA AAA MAIS P P MM STS TTI TTT II III Bg gl lll void main void set system clock frequency to BUSCLOCK MHz 24 or 4 x PLL Init EnableInterrupts t2 Init 0 init PWM ADC Init SCI1 Init BAUD 115200 initialize LCD display initLCD setting PORTA as output
167. n gt yo amp yn lt 0 oe oe oe oo oe oo o oe oo Coordinates of the center of the circle 3 or 4 xn xo amp yn lt yo xn xo amp yn lt yo Region Region Region Region Region Region Region Region Region Region Region Region Region Region Region Ll 12 10 xn yn are located Appendix A Matlab Codes 122 Area 2 pi 2 alphatbeta M CHAR R n NR sin beta sin phi sin phi beta oe oe Coordinates of the center of the circle xn yn are located in Region 5 6 7 or 8 oe oe elseif xn xo amp yn lt yo amp yn 0 xn xo amp yn yo amp yn lt 0 wa XO i ipd amp yn gt 0 xn lt xo amp yn gt yo amp yn 0 Ax 2 e E RURAL ps MES c 1 amp length xint if dxz0 amp es Axy 2 pi 2 alphatbeta ee Ei cos phi cos phit alpha sin beta sin phi sin phi beta Area Ax Axy elseif ios pm Axy 2 pi 2 alpha 1 2 xsin 2 xalpha Area E elseif MEO amp DE Axy 2 pi 2 beta 1 2 sin 2 beta Area Hue elseif dx 0 amp dy Area p1 4 x 172 end elseif length c 0 length xint Area Ax end Coordinates of the center of the circle xn yn are located in Region 9 10 11 or 12 elseif yn gt yo amp xn lt xo amp xn gt 0 yn gt yo amp xn gt
168. n init Woixinput tst 0 1 divy x_test f x_test 0_01 loops h an zeros No Np zeros No Np WohxPHI 1 Ni Y_test Y_hat_tst EI zeros Nw Ni Np MS phi p 3 1 phi j i PHI 1 3 simulated data with gaps w z j i zeros Nw Ni Np zeros Nw Ni Np g 99 2 testing neg0 55 divx l Nw squeeze PHI sum sum E E tor i zeros Nw Ni Np ones 1 Nw Np for J SSE Np test6 save MSE test simulated data with gaps w end ones 1 Np clear all input tst Z Y_hat_tst Y hat tst E E gamma cle load loops load load N Np phi phi p PHI p PHI end PHI SSE MSE MS Appendix A Matlab Codes 146 o o o o e o o ox ox ox ox ox ox oe oe oe oe ox ox ox ox oe ox ox ox ox X ox ox ox ox X ox ox ox ox X ox ox ox ox ox ox ox ox oe oe ox ox ox ox X ox ox ox ox X ox ox ox ox oe oe ox ox ox ox oe ox ox ox ox oe oe ox ox o oe ox ox ox X X ox ox ox ox ox ox ox ox ox X ox ox ox ox X ox ox ox ox DM oe oe ox oe oe oe oe ox ox oe X oe oe ox ox ox X ox oe oe ox oe oe ox oe oe X ox ox ox oe oe o o o o oe oe o o o9 o o oe oe e o9 A o9 o9 oe oe e Je o AL AS oe 9 9 9 9 9 9 O 9 o Comparing the MSE values after training simulated data with gaps and testing for simul
169. nd d 0 then The power of the shaded region is P iPr else if N 0 and Nin 2 then The power of the shaded region is P P end if else if x y Ro Rio Ri1 or Rio then Check the following if N 1 and Nin 2 then Check the following if d 0 and d 40 or d 40 and d 0 or d 0 and d Z 0 then The power of the shaded region is P P Py else if d 0 and d 0 then The power of the shaded region is P Pp end if else if N 0 and Nin 2 then The power of the shaded region is P P end if else if x y Ris Ris Ris or Rig then Check the following if N 1 and Nin 2 then The power of the shaded region is P Pr P P Pry 4 2 Theoretical Optical Acquisition Model 64 else if N 0 and Nin 4 then The power of the shaded region is P Pr P P end if end if 4 2 2 Modeling System Imperfections The quadcell array of photodetectors has been modeled according to the ori entation shown in Figure 4 8 Each photocell is represented as a 1 cmx1 cm square with centers S1 55 55 and S4 The photocells are separated by a small horizontal distance e and a vertical distance In this case the origin of the absolute Cartesian coordinate system is located at the center of the array The coordinates of S1 S2 S3 and 54 with respect to the origin are x 0 5 2 1 TE i Y 0 5 9 2 0 5 2 Busse Mee 0 5 2 C d p Y3 0 5 6 2
170. ng wid m Vid ff yd m vw dv 33 From this representation clearly w d m 0 when d 0 As d becomes small the graph of fen oe EG becomes tall and skinny as illustrated in the graphs of 410 and 41 20 with v x z given in Figures 3 3 and 3 4 respectively Therefore the frequency of Wam ze increases as d decreases In addition if most of the support of v that is the nonzero part of the graph of v is located near the origin then most of the support of Wam will be located near x m So w d m measures the frequency component of f that vibrates with frequency proportional to 1 d near the point x m 3 3 Wavelet Transforms 36 3 2 1 0 1 2 3 2 Figure 3 3 Graph of Y1 0 1 v z xe 26 Figure 3 4 Graph of 41 20 26 3 3 Wavelet Transforms 37 3 3 2 Inverse Wavelet Transform The inversion formula of the wavelet transform is given in the following theorem Theorem 2 1 Suppose y is a continuous wavelet satisfying the following condi tions i has exponential decay at infinity and f y x dz 0 Then for any function co f L R the following inversion formula holds zou Tf 1 2w d m gt f id ary Z am ad 3 4 00 CoO where the Fourier transform 1 w of v satisfies the following condition in 26 23 oe IE 2 Cm f Peas lt o 3 5 Therefore according to the continuous wavelet de
171. ngth SCI1_OutChar character character SCI1_InChar if sign 1 return number else return number SCI1_OutUDec Output a 16 bit number in unsigned decimal format Appendix D Microcontroller Code 217 Input 16 bit number to be transferred Output none Nariable format 1 5 digits with no space before or after void SCI1 OutUDec unsigned short n This function uses recursion to convert decimal number y of unspecified length as an ASCII string if n gt 10 SCI1 OutUDec n 10 n n 10 SCIl OutChar n 0 n is between 0 and 9 Jj i SCI1_InUHex Accepts ASCII input in unsigned hexadecimal base 16 format Input none Output 16 bit unsigned number Just enter the 1 to 4 hex digits It will convert lower case a f to uppercase A F and converts to a 16 bit unsigned number 4 value range is 0 to FFFF If you enter a number above FFFF it will truncate without an error Backspace will remove last digit typed unsigned short SCI1_InUHex void unsigned short number 0 digit length 0 char character character SCIl_InChar while character CR digit 0x10 assume bad if character gt 0 amp amp character lt 9 digit character 0 else if character gt A amp amp character lt F digit character A 0xA else if character gt a amp amp ch
172. nt This is apparent in both equations 2 11 and 2 12 where E depends on the time derivative of B and where H varies with the magnitude or di rection of the current flow or with the time derivative of D Nevertheless an equation that describes the propagation of electric waves is expected to be independent of the terms that include the magnetic field and vice versa Since only two equations 2 11 and 2 12 describe the dynamic effect of these two fields we will be using them as our initial point for deriving the equations describing the propagation of electric or magnetic waves We first consider equation 2 11 The simplest way of eliminating the magnetic field term from this equation is by obtaining the curl of both sides DL SH 2 15 V x V x E z V x B uz Assuming that the magnetic permeability y is constant it was placed outside the derivative operators thereby leaving only the magnetic field to be operated on How ever the term V x H in equation 2 15 can be replaced by the right hand side of equation 2 12 thereby eliminating the magnetic field term The following equation 0 OD u gt j 2 1 VxVxE x xi 2 16 07D Oj H OR Hop 2 17 is now in the desired form it contains only terms of electric field or electric charge Furthermore it includes both time and space derivations of these quantities and so describes both the temporal and spatial variation of the electric field due to the m
173. o oe oo oe o o oe oo oe o oe oo oe oo oe oe o oo o oe oo oe oo oe oo oe oo oo oo oo oe oo oe oo oe oo oo oo oo oe oo oo oo oo oo oe oo oo oo oo oo oe oo oo oo oe oo oe oo oo oo oo oo oo oo oo oo oo oe oo oo oo oo o oo oo oo oe oo oe oo oo oo oo oo oo oo oo oe oo o oo oo oo oo oe oo oo oo oe oo oo oo oo oe oo oo oo oo oo oe oo oo oo oo oo oe oo 55 Function to calculate y coordinates of the intersection 55 points between the circular beam spot and the right or o oe oe oe oe oe o oe oe oP oe o o o o oe o o o oe oe O o N 0 i9 Q Ey O Y O A G E o 7 K Q 4 O E ae o s 9 Q 28 e N A Qo o zi Gey n Y A Oo al H O oe ll gt oO a DO 0 ied E Ga n 0 0 Ga P 90 Y Y H r O H Y H H oe oe oe o oe oe oe oo oo oo oo oo oe oo oo oo oo oe oo oe oo oo oo oe oo oo oe oo oe oo oo oo oe oo oe oo oo o oo oe oo oe oo oe oo oe oo oo oo oo oo oo oe oo oe o oo oo oo oe oo oo oo oe oo oe oo oo oo oo oo oe oo oe oo oe oo oe oo oo oo oo oo oo oo oo oe oo oo oo oo oo oo oe oo oe oo oo oo oe oo oo oo oo oo oo oe oo oe oo oe oo oo oo oo oe oo oo oo oe oo oo oo oo oe oo oo oo oe oo oe oo oo oo oo oo o oe oe oe x xk x x coordinate of
174. o oo oo oo oo oo oe oo oo oo oe oo oo oo oo oo oo oo oo oe oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oe oo oo oo oo oo oo oo oo oo oo oo oo oo o oo oo oo oo oo oo oo oe oo oo oo oo oo oo oo clear all ele dimension of the square photoce dimension of the square photoce SRadius of the circle xo 0 5 0 5 9 KJ r yo coordinate of the beam spot center coordinate of the beam spot center f 2 2 xn 2 0 01 yn 2 0 01 yo y2 o 6 Yo r yl x1 x0 Xx2 Xx0 Eck kk ke ck ck KR ck ck KK KKK KKK KK KK KR KKK KKK KKK KKK RARAS ting the points of intersection between the oo oo beam spot and the square photocell circy x1l r xn s yn t circy x2 r xn s yn t eirtox yl r xn s yn t cirgx y2 r xn s yni t Sk ck KR KKK KKK ck ck ck KKK KKK ck ck cock ck KK KK KKK KKK RK ck KARA ARK ck ck ck ck 5 xu N H N re a Fed x x Pal gt Y Y Y Y 10 10 10 S S a S ja yo ge jo ad A X od X nd go t9 Or c T p p SUSO SOSO OH OH OW oH G ll Il ll ll G gt 0 O Q Q x DA BAR ee ie GAT 4 xd KN ap PpPODE DE DE DE y DES GT aT SO 8 GOA ANA A d Xd X qo Hp Lp s P sP s Os dae 0 0 OA OAR 3 m de T LJ ci a AN SeA ON O y l p 6 Q oO Q QA GO Q Pod n Pops
175. o oo oo oo oo oo oo oe oo oe oo o oo o oo oo oe oo oo oo o oo oo oo oo oo oo oo oo oo oo oo oe oe oo oo oo oo oo oo oo oo oo oe oo oo oo oo oo oo oo oo oo oo oo oe oo oo oo oo oo oo oo oe oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oe oo oo oo oo oo oo oo clear all ele dimension of the square photoce dimension of the square photoce SRadius of the circle xo 0 5 0 5 9 oO r yo coordinate of the beam spot center coordinate of the beam spot center 9 oO F 2 2 0 01 0 01 2 2 snF yn yo Fr yl yo y2 yo Xl x0 x2 Xx0 Eck kk ke ck ck kk ck ck ck ck ck KKK KK KK KKK KKK ck ck ck KKK KKK KEK ckckckckckckckckck ck ck 5 ting the points of intersection between the oo oo beam spot and the square photocell circy xl r xn s yn t circy x2 r xn s yn t circx yl r xn s yn t exrox y2 r xn s yn t Eck ck ck ke ck ck kk ck ck KK KKK KKK KKK KR KKK KKK KKK KKK KKK KKK kc ck ck ckck ck ck ck ck ck 5 ol N H N rom ae E x x Pal Pal Y Y Y Y 10 10 S S S S ye Je ya Oo Duc Dn X ond X nd go t9 TPT Pe CT PUO coco S amp S 0G Oo OH OH OH gd uU S ll ll Il Il GAQ Q Q O x D DA SA OR 4 04 0 AN X oc X OQ ap PODES DOCS DES DE y DE eT aT E O GER UO
176. o recommended to have ak and bk as integers or rational numbers rather than irrational values Further adjustments can be made to the above dyadic initialization code to account for irrational cases 2 FEEDFORWARD ALGORITHM The feedforward matrix equation for the wavelet network for a pattern p can be stated as follows 2 Feedforward Algorithm 168 p Yi p Ya y Won 9 Wai I 15 Yk p UN where the vectors ES T nela qu ess gps zh and n T o ar Q5 7 Du ah E The symbol in equation 15 represents a matrix multiplication Since batch processing is used in training the wavelet network for a total of N patterns equation 15 can be rewritten in the following form F PPP Y Won xD Wa 1 16 where the matrices IE oe JP IN and e Q2 P uu or In order to compute the N x N matrix Y hat Y let us first define the 3D array PHI 9 with N pages Each page of consists of the row vector The elements of the 3D array PHI are initialized to ones 2 Feedforward Algorithm 169 PHI ones 1 Nw Np to be used in the following for loops for computing the parameters 7 f for j 1 Nw for i 1 Ni Z j i x 1 m j 1 d 3 4 phi j i z jri exp 0 5 z j i 2 phi p j i z j i 2 1 exp 0 5 z j i 2 PHI 1 j PHI 1 j phi j i end end In this case z Z is a 3
177. odiodes Therefore the experimental values for e and 6 can be approximated to 0 1 cm and 0 3 cm Using those values in the simulation gave us a normalized power of 6 90e 02 at the origin of the quadcell plane This is about 72 4 power drop when compared to the ideal case and 52 5 power drop relative to the case when e 6 0 1 cm 4 3 EXPERIMENTAL STUDY OF THE POSITION DETECTOR 4 3 1 Experimental Setup A laboratory prototype of the optical acquisition system has been implemented to verify the results obtained through simulation and to idenitify the perfor mance of the WN with experimental testing data 4 3 Experimental Study of the Position Detector 70 Normalized Power Figure 4 15 Plot of the normalized power for photocell 1 vs e when the beam center is at the origin of the quadcell plane e and 6 are assumed to be equal Normalized Power Figure 4 16 Plot of normalized power for photocell 1 vs e and 6 when the beam centroid is at the origin of the quadcell plane 4 3 Experimental Study of the Position Detector 71 Signal Conditioning Single mode Circuit Power Supply Beam Expander Fiber Cable y b A DAQ Microcontroller Collimator NI PCI 6143 68HCS12 Figure 4 17 Experimental prototype of the optical power acquisition system Quadcell Detector Quad cell Detector we Microcontroller 68HCS12 pwm2 Analog input Setting PWM Duty cycle X
178. oe o oe o oe o oe o oe o oe o oe o oe o oe oe oe o oe oe oe o oe oe oe o oe oe oe o oe o oe oe oe o oe oe oe o o o9 o9 o oP o9 oe oe oe o o o Ae AL AL oe oe oe oe o oe o o o9 oe oe oe oe oe oe oe o oe o oe oe oe o oe oe oe o oe o oe o oe o oe o oe o3 lt 0 ER o 2 5 D el o 5 E me B w ining for multiple input multi output MIMO function approximation using dyadic grid for WN initialization filename wavnet52 dyadic initialization m ge E oO xj Hh H ct Gr 0 d o lt 0 Q lel 0 l D n B5 E y N o o wo o o A o o o o o oe oe o AN o9 AP AP o9 AP AP oe oe o o o o o AP P P P oe oe oe K o9 o0 oe oe oe o9 H o oe o oe oo oo oe oe oe oe o oe oe oe oe oe o oe o oe o oe op oo oe oe oe oe oe oe o oe o oe oe oe o oe o oe o oe oo oo oo oe oe oe o oe o oe o oe o oe o oe op oe oe oe oo oo oe oe oe oe o oe oe oe o oe o oe o oe o oe op oo oo oo oe oe oe oe o oe o oe oe oe o oe o oe o oe oo oo oo oe oe oe op oo oe oe Q bh O n 0 w clear al ele Loading input output simulated data no gaps Loading input output simulated data with gaps Loading input output experimental data load inoutzero txt Load inout txt load inoutexp o A oe tic 9 2 O o WN Initi
179. oller Code 203 else countx1 1 TFLG1 0x04 pin2 CLKX void TIC2ISRY if PORTB amp 0x04 0x00 if county1 0x00 countyl 0xff county2 else countyl if PORTB amp 0x04 0x04 if countyl 0xff county1 0x00 county2 else countyl tt TFLG1 0x08 pin3 CLKY v id TICISR SCI1_OutChar 0x0d SCI1_OutUDec countx2 SCIl OutChar SCI1 OutUDec countx1 ff SGll3oQutcChar Th SCI1_OutUDec county2 SOCII QutChar s SCIl OutUDec county TFLG1 0x02 pinl void OV F ISR xOverflow Interrupt TFLG2 0x80 pragma CODE_SEG DEFAULT Appendix D Microcontroller Code 204 CAIO TAT TI AAT AA AT AA TAA AT ANCA AAA TTA TAA TAT TAA TAA TATA AT AT AT I Dragon 12 LCD Header file x ifndef LCD H define _LCD_H_ declare public functions x void initLCD void must be called first to init LCD void lcd puts char string write a string to LCD write single char as command or data to LCD lcd write unsigned char x unsigned char rs void put num unsigned int no write a number to LCD void put signed num int num write signed nu Move cursor to specific Line and offset location void lcd goto unsigned char line unsigned char offset define Linel 0x80 Linel address in LCD define Line2 0xc0 Line2 address in LCD fendif LCD H x Appendix D M
180. olution for the x data used in the training is 0 1 cm and the resolution for the y data used in the training is 0 02 cm 0 4 Theoretical model O WN test output 0 3r o9 J 0 2r J 0 1 7 5 x cm Figure 5 9 Comparing the WN test output and the theoretical model with gaps for vertical scanning at x 0 cm The resolution for the z data used in the training is 0 1 cm and the resolution for the y data used in the training is 0 02 cm 5 2 Training and Testing of Wavelet Network 90 0 4 Theoretical model O WN test output 0 37 0 27 0 1f x cm o 10 20 30 40 t s 0 4 Theoretical model D WN test output 0 10 20 30 40 Figure 5 10 Comparing the WN test output and the theoretical model with gaps for vertical scanning at x 0 cm The resolution for the x data used in the training is 0 1 cm and the resolution for the y data used in the training is 0 02 cm P1 Theoretical model A P1 WN test output 0 35 0 3 0 25 0 2 0 15 0 1 0 05 Normalized Power 0 35 P3 Theoretical model O P3WN test output 0 3 0 25 Normalized Power Normalized Power Normalized Power 0 35 0 3 0 25 0 2 0 15 0 1 0 05 0 35 0 3 0 25 0 2 0 15 0 1 0 05 pe 04 02 0 02 04 P2 Theoretical model O P2WN test output P4 Theoretical model PAWN
181. omatic waves 16 Where the value of the second derivative 25 U r e 7 27 f U r e can be substituted in the previous equation to arrive at v Uy j2n ft 27 ET qa mito 0 r e n3 r e V2 4 U 1 ent 0 Thus we can now state the Helmholtz equation as follows V k U r 0 2 29 where hs C C is referred to as the wavenumber 13 2 2 4 Intensity Power and Energy The optical intensity r t defined as the optical power per unit area units of watts cm2 is proportional to the average of the squared wavefunction Ii 2G y 2 30 The operation denotes averaging over a time interval of one optical cycle Using equation 2 30 along with equation 2 22 we can determine the optical intensity Where Qu r t 2a r cos 27 ft y r IU r 2cos 2rft e r Using the trigonometric identity 2cos 0 1 cos 20 we have the following repre sentation for 2u r t 2u r t U 1 1 cos 2 2r ft r 2 31 2 3 Wavefronts 17 is averaged over an optical period 1 f Tea cx eo i 1 f y e 1 cos 2 2a ft y r dt U j 1 f 1 f B i esent epa 0 0 vot Lg U e b t3 sin 2 2m ft r 0 U r P Therefore the optical intensity I r t U r of a monochromatic wave is the absolute square of its complex amplitude And interestingly as we have just shown the intensity of a monochroma
182. on was set to 0 05 cm and that for the y position was set to 0 02 cm Figure 5 20 shows the training error and the test error after training the network for 100 000 iterations for different values of N while keeping u and y fixed at 0 01 and 0 99 respectively As can be seen in Figure 5 20 we have a minimum test MSE of 7 90e 05 at Nu 15 and the corresponding training MSE has a value of 2 48e 04 In this case at N 15 the test error is lower than the training error We further investigated the performance of the WN when the experimental data at x 0 cm was used for testing The theoretical model with vertical gap 0 3 cm and horizontal gap e 0 1 cm has been used for training The resolution for the x position was set to 0 05 cm and that for the y position was set to 0 02 cm The network was trained for 100 000 iterations for different values of Nu while keeping u and y fixed at 0 01 and 0 99 respectively We obtained a minimum test error of about 1 22e 02 at N 63 for the vertical scan at x 0 cm as shown in Figure 5 23 Using the proposed system and the uniqueness condition given in equation 5 6 the maximum position detection area Aq for an ideal n photocell array with no spatial gaps is represented in Figure 5 26 and can be computed as Aa Vn 1 A 5 7 where Apn is the active area for one photocell and n is the number of photocells with yn an integer 5 2 Training and Testing of Wavelet Network
183. oordinates of the center of the circle xn yn are located in Region 13 14 15 or 16 elseif xn xo amp xn gt 0 amp yn lt yo amp yn gt 0 xn xo amp xn 0 amp yn lt yo amp yn gt 0 xn lt xo amp xn gt 0 amp yn yo amp yn 0 xn xo amp xn lt 0 amp yn yo amp yn 0 if length c 1 amp length xint Power Pc Py Px Pxy elseif length c 0 length xint c Power Pc Py Px end oe oe oe end end end Appendix A Matlab Codes 132 SESECE SESE SESE SESE SESE SEES SEES ES ESC EE EE EE EE EE EEE EEE SE EEEE SESE SESE SESS 555 5555 555555500550005000001000000000000500050000500050000000000000000000 55 Power calculation program for a quad cell photodetector 55 525 array at a certain epsilon and a while moving the SSS 55 beam spot along both the x and y axis 55 filename Quadcell POWER m SSS SSS SSS Written by Yasmine El Ashi Fall 2007 SSS 5555 55 5555555005500500000000000000000500000005000000000050000000001000 SESECE SESE SESE SESE SESE SEES SESE SES EC EE EE EE EE EE SEE EEE EE SEE SESE SESE SESS cl clear all epsn 0 1 SEpsilon horizontal gap dlta 0 3 Delta vertical gap xs1 0 5 epsn 2 ys1 0 5 dlta 2 Centre of photocell 1 xs2 0 5 epsn 2 ys2 0 5 dlta 2 Centre of photocell 2 xs3 0 5 epsn 2 ys3 0 5 d1ta 2 Centre of photocell 3 xs4 0 5 epsn 2 ys4 0
184. otion of electric charges Although this equation is complete in itself it can be further simplified by using the vector identity V x V x A V V A V A where A is an arbitrary vector and V V V is the Laplacian operator Thus in the Cartesian coordinate system operating on any vector A A Ay y A 6 with 2 1 The Wave Equation 13 the Laplacian yields OA UC Ag OA OA OA OPA 2 x x x An M V V y Ma Ox Oy On Spo r Oy 02 ay PA OPA OA i Ox Oy 8 2 Thus the left hand side of equation 2 17 can be replaced by VxVxE V V E VE 2 18 However when the medium in which E propagates is homogeneous i e when all the spatial derivatives of the electric permeability vanish and when the medium does not contain any free charges i e p 0 the first of these terms is V E 0 With the above vector identities equation 2 17 can be reduced to cE 0j om ae V E y 2 19 This is the wave equation that describes the propagation of an electric wave It does not specify what caused the field or how the field can be annihilated but it accurately predicts the magnitude and direction of E at any point in space or time Since most optical elements consist of uniform media the assumption that e is constant is always justified The second assumption that is that the density of unbalanced electric charges is p 0 is met in free space and in all electrically neu
185. pin 0 BRK for Y pin 2 DIR for Y pin 4 BRK for X pin 6 DIR for X DDRA OxFF PORTA 0x10 For DDRB 0x00 y PORTB x y OxFA PWMDTYO x PWMDTY1 x show_result Appendix D Microcontroller Code 196 LULIT t A LIT LIShnowResult ITI4 PP M PB PP A LLL void show_result lcd goto Linel 0 lcd_puts put signed num countx2 lcd puts LAT put signed num countx1 lcd puts lcd goto Line2 0 lcd puts Lp ie put signed num county2 lcd puts T put signed num countyl Lcd puts ie LM MB MMIMM sIlMIIIIIMMTteITRE END TZ 1 1 1000 10 TTS TST TTT ST Appendix D Microcontroller Code 197 LILIUS T CII JAsr vectors c VZV V V M MP MP MP MP M M MM M gMMlMHMMMIlM extern void near Startup void Startup routine x declarations of interrupt service routines x extern interrupt void OV_F_ISR void extern interrupt void TIC2ISRX void extern interrupt void TIC2ISRY void extern interrupt void TICISR void extern interrupt void SCIl_isr void pragma CODE SEG NEAR SEG NON_BANKED x Interrupt section for this module Placement will be in NON BANKED area interrupt void UnimplementedISR void Unimplemented ISRs trap x asm BGND typedef void near tIsrFunc void const tIsrFunc vect OxFF80 Interrupt t
186. potential application for the position detection system is in vibration moni toring Referring to Figure 4 1 if the mirror is placed on a vibrating platform this will induce beam vibration where the position of the beam center will be changing as a function of time Future work can be done to utilize the position information to find certain vibration characteristics such as speed acceleration frequency spectrum and amplitude 5 3 Vibration Monitoring 100 Figure 5 26 Shaded region indicates the area of detection and x represents the center of one photocell Conclusions In this research an optical position detection scheme using Gaussian beam analysis and wavelet networks has been introduced The closed form equa tions for the optical power covered by a certain area of overlap between the laser beam spot and one photodetector were derived as the beam moves through out the entire x y plane Accordingly the power distribution acquired by a quadcell photodetector array was evaluated taking into consideration the ver tical and horizontal spatial gaps 6 and e A laboratory setup of the optical acquisition model was implemented to validate the results from the theoretical model and to assess the performance of the WN with experimental data The input to the WN is the photodetector array power distribution and the output is an estimate of the x and y position of the laser beam center The aspects of practical implementation and exp
187. ptical lateral position sensor for vibration monitoring using a 2x2 photodetector array In our approach the power distribution of the light spot is measured taking into consideration the radial symmetry of the spot and its Gaussian intensity profile The proposed system uses a He Ne laser source whose Gaussian beam impinges on the photodetector array The normalized optical power for each photocell is obtained theoretically by deriving the optical power equations as the beam scans the plane of photodetectors The position detection is based on finding a relationship between the power distribution of the photodetector array and the position of the beam center An experimental setup of the system is developed to validate the theoretical results Furthermore a wavelet network function approximation technique is used to estimate the x y position of the beam center corresponding to the measured optical powers ill Abstract List of Figures List of Tables Acknowledgements 1 Introduction 2 Beam Optics 2 1 Th Wave Equation 239 999 Seda EG s 2 2 Monochromatic waves lt lt m non 2 21 Complex wavefunction 2 2 2 Complex Amplitude 6 06044045 2 2 8 The Helmholtz Equation 2 2 4 Intensity Power and Energy 20 ANIOS ec y oe RR qne oe de Y ode Y oe hod 2 3 1 The Plane Wave 4 255593 3 os 2 3 2 Paraxial Waves a lt a Cx Hw eH 2 3 3 The Gaussian Beam 3 Functional Approximat
188. put D WN test output 0 4 0 4 0 10 20 30 0 10 20 30 t s t s Figure 5 25 Comparing the WN test output and the experimental data for vertical scanning at x 0 cm as a function of time The resolution for the x data used in the training is 0 05 cm and the resolution for the y data used in the training is 0 02 cm 5 3 Vibration Monitoring 99 5 3 VIBRATION MONITORING In order to achieve a better fitting between the WN test output and the ex perimental data as shown in Figure 5 24 further adjustments should be made to improve the accuracy of the experimental setup This involves reducing the vertical and horizontal gaps between the photocells as well as eliminating any sources of power loss along the x 0 cm axis of the photodetector array in the optical acquisition system In addition more vertical scans should be made within the detection area with a lower resolution for the x position lt 0 05 cm One of the additional features of the proposed system is that it allows us to measure the rate of change of Y using equation 5 8 where dP dt is the rate of change of power distribution and OY OP is the Jacobian matrix of Y with respect to P as the beam moves along the plane of photocells dY OY dP dt OP dt 5 8 The Jacobian matrix OY OP can be computed using the trained WN by taking the partial derivative with respect to P of equation 5 1 as stated below OY opr dii Won 5 9 JP h 5 9 02 A
189. r which it fluctuates around 2 6 We observe the least fluctuation at N 511 where the MSE saturates to a value of about 2 619 at 10000 learning iterations In an attempt to force the MSE to converge the training data set has been reduced by removing the patterns where none of the four photocells is detecting power as well as removing the patterns where only one photocell is detecting 5 2 Training and Testing of Wavelet Network 85 power by applying the following condition P 0N Py 0N Ps 0NR 0 P Z0nP 20nP 20nP 20 P 20nP Z0nP 0nP 20 P 0nP 20nP Z0nP 20 P 20nP 20nP 20nP Zz0 U U 5 5 U U Figure 5 5 shows the plot of the MSE vs the number of learning iterations after applying condition 5 5 to the training data for N 15 and N 127 while setting u and y to 0 1 and 0 9 Using these settings the MSE starts dropping from a value of about 0 530 for both curves then experiences a highly fluctuating behavior after reaching a value of 0 446 at iteration number 1151 for N 127 and a value of about 0 473 at iteration number 1729 for N 15 In order to achieve better results the number of observations has been re stricted to those where all four photocells are detecting power therefore the preprocessing uniqueness condition Py 001 P 00 P x 0n P 0 5 6 has been imposed on the input data After applying such a condition on the theoretical data without gaps the MSE demonstrated a much bett
190. ransform 20 To elaborate more on the preceding point in order for us to obtain a discrete reconstruction as shown in equation 3 6 instead of using a fixed lattice of dj m we can adaptively determine the values of dj mj according to the function f or the sampled input output data in the set By following such a methodology all the parameters w dj and m in equation 3 6 are to be adapted Thus equation 3 6 is very similar to a one hidden layer feedforward neural network Such adaptive discrete inverse wavelet transform is called wavelet network From this perspective equation 3 6 can be constructed using techniques of neural networks Usually neural networks used in function approximation are first randomly initialized and then trained by a backpropagation procedure The random initialization makes such learning procedures very inefficient In contrast wavelet networks can be initialized with regular wavelet lattice as will be shown later in Chapter 5 It is to be remarked that the regular lattices of wavelet frames are special cases of adaptive discretizations of the continuous inverse wavelet transform Consequently the discrete reconstruction formula in equation 3 6 must hold for some properly adapted d m Furthermore if the function f has some particular 3 4 Wavelet Networks WN 40 property of regularity better results can be obtained due to the flexibility of the adaptive wavelet family 20
191. return number is changed and a backspace is outputted to the screen else if character BS amp amp length number 10 length SCI1_OutChar character character SCI1_InChar return number Appendix D Microcontroller Code 215 SCII InSDe c Ed td si si InSDec accepts ASCII input in signed decimal format and converts to a 16 bit signed number valid range is 32768 to 32767 Input none Output 16 bit signed number If you enter a number outside 32767 it will truncate without an error Backspace will remove last digit typed gned int SCI1 InSDec void gned int number 0 length 0 char sign 0 0 pos 1 neg char character character SCIl_InChar while character CR accepts until carriage return input The next lines checks for an optional sign character or and then that the input is a digit 0 9 If the character is not 0 9 it is ignored and not echoed if character SCI1_OutChar character else if character sign 1 SCI1_OutChar character else if character gt 0 amp amp character lt 9 this line overflows if above 4294967296 number 10xnumber character 0 length SCI1_OutChar character If the input is a backspace then the return number is changed and a backspace is outputted to the screen else if character BS
192. rment is usually performed by calculating the center of gravity of the light distribution 11 The quadcell array for lateral two dimensional position measurement consists of square shaped and homogeneous photodetectors PDs clustered in a 2x2 config uration 12 The lateral dimensions of standard discrete commercial PSDs extend up to several millimeters Using a quadcell array of photodetectors involves several ad vantages such as large position measurement area reduced number of direct output signals acceptance of a wide range of spot intensity profiles and radii negligible spa tial fluctuation of the signal immunity to coordinate crosstalk and possible operation with modulated or pulsed light 12 The transfer characteristics of the photodetector depend on the shape and intensity distribution of the beam spot In 1 the authors used a perfectly linear transfer function by assuming a square light spot with uniform intensity distribution and with its edges parallel to the edges of the quadrants However in most practi cal conditions the spot intensity profile exhibits radial symmetry and the resulting response is non linear 12 The purpose of this research is to present a wavelet network based non contact optical position sensor using a photodetector array which measures the power distri bution of the light spot taking into consideration the nonlinearities involved that is the radial symmetry of the spot and its Gauss
193. rsection Az as the beam is moved along both the x and y axis of the photodetector plane the parameters o4 61 de zo dy y Yo tan d d p x 20 sino and p y yo sin B as shown in Figure 4 4 are first evaluated The angle o which is measured from the horizontal axis passing through the center of the beam spot to the corner of the photocell within the spot region bisects the area Asy into A and A To compute Asy the expressions for 4 2 Theoretical Optical Acquisition Model 50 Figure 4 4 Parameters definition for area Ay areas A and A5 are found then the sum of both is taken a2 po Ay f J m 9 T Px P p 1f z d 5 Po Pe da ext nS tz 1 Q3 3 a2 c4 m po Nu x ao da po 1 x mi 2 sin a 2 po sin a 6 3 E 2 F 9 2 Qa 2 F Po sin ay Po T posin ay 1 fe is da les 6 7 f d 2 sin a 2 d e 2 2 sin y 3 6 3 2 da po 7 po SIN ay a E pman i dod _ pot E NEM po sin a E p Oke uae 2 T 2 5 2 2 _ Po E mb 0 po sin ay oe sin 1 2 4 9 2 L2 2 sinag cos 7 2 Using the trignometric identities sin A B sin A cos Btcos Asin B and cos A B 4 2 Theoretical Optical Acquisition Model 51 cos A cos B sin Asin B we have the following relations COS Qg cos T 01 cos cos o sin m sina cosa 4 10 sin sin 7 04 sin 7 cos a cos T sina sina 4 11 cos 7 2 cos
194. s magnetic counterpart representing the absence of magnetic monopoles Thus the zero term in brackets in equation 2 11 is the magnetic analog to the current density jin equation 2 12 Similarly the charge density term p in equation 2 13 is replaced by a zero in equation 2 14 Maxwell s equations form the basis for the development of the equations that describe the propagation of electromagnetic waves Historically the electromagnetic wave equations were derived by Maxwell merely to describe the propagation of oscil lating electric or magnetic fields in space Neither Maxwell nor his peers recognized the relation between the propagation of electromagnetic fields and the propagation of light Optics and the propagation of electromagnetic waves were at that time considered to be separate and unrelated fields of physics Only after showing that the propagation velocity of electromagnetic waves was identical to the already mea sured speed of light Maxwell suggested that his results might be more general than expected and hence applicable to the studies of optics 2 1 The Wave Equation 12 Inspection of Maxwell s equations reveals that when the magnets or electric charges are static the electric field vector in equation 2 13 does not contain any terms of the magnetic field and conversely in equation 2 14 is independent of the electric field When in motion however the magnets or electric charges induce fields that are interdepende
195. s is composed of a mirror which reflects the beam onto the quadcell detector Each photodiode FDS1010 Thorlabs is connected to an RC noise filter with a cut off frequency of about 10 kHz and an amplification circuitry as shown in Figure 4 21 33 The output voltages of the photodiodes are fed into four simultaneously sampled analog input channels of a BNC shielded connecter block NI BNC 2110 National Instruments for the Data Acquisition Card NI PCI 6143 National Instruments which also provides a 16 bit resolution and a sampling rate of up to 250 kS s per channel Beam Expander Spatial Filter Mirror S P d y A T y Collimator Laser source Quad cell detector From Quad cell detector to DAQ Q Y Motor X Motor Figure 4 19 Optical setup of the system The quadcell array has been mounted on XY motorized linear translation stage T25XY Thorlabs fitted with incremental encoders to measure the x and y positions of the center of the beam The T25XY stage provides a travel range of about 2 5 cm and utilizes two 12 V DC servomotors with a 256 1 gear reduction 4 3 Experimental Study of the Position Detector 73 Single Mode Fiber Cable Mirror XY Stage M Quad cell Detector Ka Beam Expander a b Figure 4 20 a Transmission optics b Reception optics Amplification Noise Filter A A Figure 4 21 Signal conditioning circuitry for pho
196. serting them into the above double integral we attain to the following I En Therefore the total optical power can be stated as 1 2 Pr zh nW 2 60 where the result is independent of z Thus the beam power is one half the peak intensity times the beam area Since beams are often described by their power P it is useful to express Jp in terms of P using equation 2 60 and to rewrite equation 2 57 in the form 2 Pr 2p 10 2 727 E 2 61 The ratio of the power carried within a circle of radius po in the transverse plane at position z to the total power is po I p z 2mpdp 1 ex 22 2 62 pia A il Pr p z 2n pdp eXp Ta 2 0 The power contained within a circle of radius po W z is approximately 86 of the total power About 99 of the power is contained within a circle of radius 1 5W z Since the radius of the circular spot is py 0 5 cm then to achieve 99 of the total power W was set to 1 3 cm in the theoretical model Therefore the minimum beam waist 2Wo is equal to 2 3 cm Functional Approximation with Wavelet Networks In order to estimate the lateral position of the light spot center corresponding to the power distribution of the photodetector array a wavelet network will be used as a function approximation technique In this chapter we will introduce the concept of function approximation and neural networks Next we will discuss the relation between the wavelet
197. set up TX ring buffer x RB INIT amp in inbuf 255 set up RX ring buffer x x check if bus frequency has been boosted to 24 MHz fw 07 04 x dif _BUSCLOCK 24 24 MHz bus frequency PLL is used SYNR 2 REFDV 0 gt factor 6 Baud rate generator SCIIBDL H 24e6 16 baudrate 1 5e6 baudrate x switch baudRate case BAUD_300 SCI1BDH 19 SCI1BDL 136 break case BAUD 600 SCI1BDH 9 SCI1BDL 196 break case BAUD 1200 SCI1BDH 4 SCI1BDL 226 break case BAUD 2400 SCI1BDH 25 SCI1BDL 113 break case BAUD_4800 SCIIBDH 1 SCI1BDL 56 break case BAUD_9600 Appendix D Microcontroller Code 211 SCI1 SCI1BD break case BAU SCII SCI1BD break case BAU SCI1 SCI1BD break case BAU SCI1 SCIIBD break case BAU SCLI SCI1BD break else 4 MHz bus frequency Baud rate generator SCIIBDL H L 156 D 19200 BDH 0 L 78 D 38400 BDH 0 L 39 D 57600 BDH 0 L 26 D 115200 BDH 0 L 13 switch baudRate case BAU SCI1 SCI1BD break Case BAU SCI1 SCI1BD break Case BAU SCII SCI1BD break case BAU SCI1 SCI1BD break case BAU SCI1 SCI1BD break case BAU SCII SCE break case BAU SCI1 SCI1BD break tendif x D 300 BDH 3 L 64 D 600 BDH 1 L 160 D 1200 BDH 0 L 208 D 2400 BDH 0 L 104 D 4800 BDH 0 L 52 D 9600 BDL D 19200 BD
198. strlen x include scil h jdinclude pll A macro SYSCLOCK x eine lode rs n ring buffer macros x define MAX_BUFLEN 128 static char outbuf 2 MAX_BUFLEN memory for ring buffer 1 TXD static char inbuf 2xMAX BUFLEN memory for ring buffer 2 RXD define o p and i p ring buffer control structures static struct out gt global to this file x static RB CREATE out char static struct in gt global to this file static RB CREATE in char x rs interrupt handler define RDRF 0x20 Receive Data Register Full Bit define TDRE 0x80 Transmit Data Register Empty Bit interrupt void SCIl_isr void determine cause of interrupt if SCI1SR1 amp RDRF 0 Receive Data Register Full gt fetch character and store x if RB FULL amp in store the value of SCIIDRL in the ring buffer RB PUSHSLOT amp in SCIIDRL RB PUSHADVANCE amp in next write location x PORTB 0x01 else if SCI1SR1 amp TDRE 0 Transmission Data Register Empty gt send x Appendix D Microcontroller Code 209 if RB EMPTY amp out start transmission of next character SCIIDRL RB_POPSLOT amp 0ut remove the sent character from the ring buffer x RB_POPADVANCE amp out else buffer empty gt disable TX interrupt SCI1CR2 amp
199. t 0 amp abs V Yc 3 nyc lt 0 001 vy 3 1 find abs V Yc 3 1 gt 0 vy 3 2 find abs V Yc 3 nyc Appendix A Matlab Codes 133 vy 4 1 find abs V Yc 4 1 gt 0 vy 4 2 find abs V Yc 4 nyc dx 1 1 vx 1 1 1 dx 1 2 nxV vx 1 dx 2 1 vx 2 1 1 dx 2 2 nxV vx 2 dx 3 1 vx 3 1 1 dx 3 2 nxV vx 3 dx 4 1 vx 4 1 1 dx 4 2 nxV vx 4 Dx 1 1 dx 1 1 1 Dx 1 2 nxV dx 1 Dx 2 1 dx 2 1 1 Dx 2 2 nxV dx 2 Dx 3 1 dx 3 1 1 Dx 3 2 nxV dx 3 Dx 4 1 dx 4 1 1 Dx 4 2 nxV dx 4 dy 1 1 vy 1 1 1 dy 1 2 nyV vy 1 dy 2 1 vy 2 1 1 dy 2 2 nyV vy 2 dy 3 1 vy 3 1 1 dy 3 2 nyV vy 3 dy 4 1 vy 4 1 1 dy 4 2 nyV vy 4 Dy 1 1 dy 1 1 t1 Dy 1 2 nyV dy 1 Dy 2 1 dy 2 1 t1 Dy 2 2 nyV dy 2 Dy 3 1 dy 3 1 1 Dy 3 2 nyV dy 3 Dy 4 1 dy 4 1 1 Dy 4 2 nyV dy 4 PS1 Pcentre Dx 1 1 Dx 1 2 Dy 1 1 PS2 Pcentre Dx 2 1 Dx 2 2 Dy 2 1 PS3 Pcentre Dx 3 1 Dx 3 2 Dy 3 1 PS4 Pcentre Dx 4 1 Dx 4 2 Dy 4 1 figure SPlot of PS1 vs position of centre mesh xc yc PS1 xlabel x cm ylabel y cm zlabel Normalized Power colorbar figure SPlot of PS2 vs position of centre mesh xc yc PS2 xlabel x cm ylabel y cm zlabel Normalized Power
200. t coordinate separately Furthermore the weights of the direct connections by and aj are estimated using the standard least squares method Ls XTX X Y 5 4 where X is the matrix of input vectors and Y is the target output training sequence over all the patterns The weights Ck associated with the wavelet activation functions are initially set to zero For a more detailed explaination 5 2 Training and Testing of Wavelet Network 84 1 2 jet aL 0 8 Q amp 05 j 2 j 3 is 0 4 j 4 j 5 j 6 j 7 0 2 4 ae 05 0 05 1 translation Figure 5 3 Dyadic grid for wavelet network Initialization of the least squares method refer to Appendix B 5 2 TRAINING AND TESTING OF WAVELET NETWORK First the theoretical model without gaps has been used to train the wavelet network for different values of N while both the desired x and y patterns range between 2 cm and 2 cm The values of u and y were set to 0 0001 and 0 9999 The plot of the MSE vs number of learning iterations for N 127 Ny 255 and N 511 is shown in Figure 5 4 Due to the availability of non unique patterns using this data set that is input patterns with the same power values giving different x and y output patterns the MSE demonstrated a chaotic non converging behavior as the number of iterations increased The MSE at N 127 wavelons has the lowest drop at 2 595 then suddenly reaches the highest peak at 2 637 afte
201. t nodes levels hidden nodes output nodes input I x Sinput matrix C input Initializing Woi using Least Squares Method for k 1 No Woil inv C C C Y k Woil Woil Woi k Woil end SInitializing Woh to zeros Woh zeros No Nw SInitializing translation and dialation parameters Susing dyadic grid ak min x bk max x for i 1 Ni for L 1 N1 div bk i ak i 2 L n 1 p 0 while pzbk i p ak 1 i n div M n p D n div n n 1 end for w 1 n 2 f 1 w L M 2x xw 1 g 1 w L D 2 xw 1 end end F squeeze f G squeeze 9 pf gf find Fx pg gg ind Gx 0 0 js for w 1 length pf s w F pf w gf w end Appendix A Matlab Codes 140 elseif F 1 1 z0 m 1 s end for w 1 length pg t w G pg w qg w end if G 1 1 0 d i G 1 1 t elseif G 1 1 420 d i 2c 9tj end end oi zeros No Nit1 Np oh zeros No Nw Np m zeros Nw Ni Np D D D Dd zeros Nw Ni Np DWoh_aver zeros No Nw DWoi_aver zeros No Nitl Dm_aver zeros Nw Ni Dd aver zeros Nw Ni DeltaWoi_old 0 Woi Delt aWoh_old 0 Woh Deltam_old 0 m Deltad_old 0 d iterations 10 5 z zeros Nw Ni Np phi zeros Nw Ni Np phi_p zeros Nw Ni Np PHI zeros 1 Nw Np PHI pezeros Nw Ni Np Y hat zeros No Np E zeros No Np SE zeros l iterations
202. tal data set at r 0 cm The resolution for the x data used in the training is 0 05 cm and the resolution for the y data used in the training is 0 02 cm Comparing the WN test output and the experimental data for vertical scanning at x 0 cm The resolution for the z data used in the training is 0 05 cm and the resolution for the y data used in the training is 0 02 Comparing the WN test output and the experimental data for vertical scanning at r 0 cm as a function of time The resolution for the x data used in the training is 0 05 cm and the resolution for the y data used in the training is 0 02 cm 2 2 1 2 be oer ee Pee Shaded region indicates the area of detection and x represents the center of one photocell ee ix 96 97 4 1 Table showing the range of each region List of Tables Acknowledgements First and foremost I thank Allah the Most Gracious the Most Merciful for giving me the will and power to complete my thesis research and allowing me to pass through such an experience where not only do you acquire the academic skills of research but you also learn other qualities such as patience and perseverance Next I would like to express my sincere gratitude to my research advisors Dr Taha Landolsi and Dr Rached Dhaouadi to whom I owe a lot for their patience guidance and encouragement throughout the different stages of the research I highly appreciate their vision novel ideas and their
203. test output 0 4 0 2 0 0 2 0 4 y cm Figure 5 11 Comparing the WN test output and the theoretical model with gaps for vertical scanning at x 0 cm The resolution for the z data used in the training is 0 1 cm and the resolution for the y data used in the training is 0 02 cm 5 2 Training and Testing of Wavelet Network 91 Experimental data O WN test output 0 5 T T 0 4 B 8 J e 0 3 E A Q o 0 2 o o o o o O 0 1r o 8 J 8 1 S 8 5 0 1 2 d 1 E 9 0 2 o e O o 76 0 3r c oo o 04 0 5 0 0 5 X cm Figure 5 12 Comparing the WN test output and the experimental data for vertical scanning at x 0 55 cm and x 0 55 cm The resolution for the x data used in the training is 0 1 cm and the resolution for the y data used in the training is 0 02 cm 0 5 Experimental data 0 5 Experimental data O WN test output O WN test output 0 4 1 i 0 3 0 2 0 1 0 1 0 2 0 3 0000090 0 4 O 0 5lo 0 10 20 30 0 10 20 30 Figure 5 13 Comparing the WN test output and the experimental data for vertical scanning at x 0 55 cm as a function of time The resolution for the x data used in the training is 0 1 cm and the resolution for the y data used in the training is 0 02 cm 5 2 Training and Testing of Wavelet Network 92 0 6 A 0 6 O 044 95 0 4
204. th x and y axis elseif xnz0 amp ynzx0 if xn gt xo amp yn gt yo Region 1 dx xn xo dy yn yo Appendix A Matlab Codes 121 lseif dx xn xo dy yn yo lseif xn xo dx xn Xx0o dy yn yo lseif xn xo dx xn Xxo dy yn yo lseif xn xo dx xn xo dy yo yn lseif xn xo dx Xxn xo dy yotyn lseif xn lt xo dx xn xo dy yo yn lseif xn lt xo dx xn Xx0o dy yotyn lseif yn yo dx xo xn dy yn yo lseif yn gt yo dx xo txn dy yn yo lseif yn lt yo dx xo xn dy yn yo lseif yn lt yo dx xot xn dy yn yo lseif xn xo dx xo xn dy yo yn dx xo txn dy yo yn lseif xn xo dx xo xn dy yotyn dx xot xn dy yo yn end xn gt xo amp yn yo amp yn gt yo amp yn yo amp yn lt yo amp yn gt 0 amp yn yo amp yn lt 0 amp yn lt yo amp yn gt 0 amp yn yo amp yn 0 amp xn lt xo amp xn gt 0 amp xn xo amp xn 0 amp xn lt xo amp xn gt 0 amp xn xo amp xn 0 amp xn 0 lseif xn xo amp xn lt 0 amp xn 0 lseif xn xo amp xn lt 0 alpha asin dx r beta asin dy r phi atan dy dx o oe o oe if xn xo amp yn yo xn xo amp yn yo in Region Lp 27 amp amp yn lt yo amp yn gt 0 amp yn lt yo amp yn gt 0 yn gt yo yn lt 0 amp y
205. the change AA is much smaller than A itself i e AA lt lt A Since AA 04 02 Az 04 02 A 2 3 Wavefronts 2 n A m Wavefronts a A Paraxial rays b Figure 2 3 a The magnitude of a paraxial wave as a function of the axial distance z b The wavefronts and wavefront normals of a paraxial wave 13 aA po S lt kA it follows that 24A lt lt A which implies 24 lt lt 4 4 And therefore gt Oz Oz A 21 Similarly the derivative 04 0z varies slowly within the distance A so that AJO lt lt k A z and therefore OA lt lt k A dz Next we will substitute U r A r exp jkz into the Helmholtz equation and assume 924 02 to be negligible in comparison with k94 0z or k A V7 k U r 0 V k A r exp jkz 0 i OA E f 2 exp jkz exp jkz Aexp kz k A exp jkz 0 2 45 7E apt an 2 3 Wavefronts 22 The term E A exp jkz is evaluated accordingly A Aexp jkz OA e jkz jkAexp jkz Oz Oz Therefore o o A OA za Aexp jkz 7 exp Jkz jk exp jkz A jk A exp jkz jkAexp tn OPA OA 2 ae jkz 27k a exp jkz k A exp jkz Substituting the expression for 27 A exp jkz back into equation 2 45 we get OA EA A OA 2j AEREA jkz 0 am ay OL jk Dz k A k exp jkz 0 Since we assumed 0 A 0z to
206. the center of the beam spot radius of circular beam spot an Eck ck ck KR KKK KKK KK RK KK KKK KKK KKK KKK KKK KKK KKK KKK KR KKK KK KEK KEK KR KKK KKK yn Sx Input to the function oe oe JP oe oe A oe E E K E CX y coordinate of the center of the beam spot x x value of upper or lower side of the oo square photocell Output of the function o oe o 2 o x coordinate of the first point of intersection ydn x coordinate of the second point of intersection Eck ck ck ck KKK KKK ck ck KKK KKK ck ck cock ck RK KK ck ck ck KK KR KKK KKK RK KK KKK KKK KKK KR KKKKKKS yup oo oo circy x r xn yn 2 x xn 2 yn yup ydn function F 2 x xn 2 yn sqrt r yup ydn r sqrt r Appendix A Matlab Codes 116 o oe o oe oe oe o oe oe oe oe oe o oe o oe o oe o oe o oe o oe o oe oe oe o oe oe oe oe oe o oe o oe o oe o oe o oe o oe o oe oe oe o oe oe oe o oe o oe o oe o oe o oe o oe o oe o oe oe oe o oe o oe oe oe o oe o oe o oe o oe o oe oo oe oe oe o oe o oe o oe o oe o oe o oe o oe oe oe o oe oe oe o o o o o X o9 cP o o o o oe oe o oe o o o o o o o o9 o9 AP oe oe oe oe o o o o oe o o o oe o o AP oe oe o oe o oe Q w E Q fun E w 0 ct y 0 w H 0 ge O Fh ct B 0 Funct
207. tic wave does not vary with time 13 The optical power P t units of watts flowing into an area A normal to the direction of propagation of light is the integrated intensity Pes fre dA 2 32 A The optical energy units of joules collected in a given time interval is the time integral of the optical power over the time interval E Pa 2 33 2 3 WAVEFRONTS The wavefronts are the surfaces of equal phase y r constant The constants are often taken to be multiples of 27 y r 2 4 where q is an integer The wavefront normal at position r is parallel to the gradient vector Vy r a vector with components 0y 0x Ov Oy and 0p 0z in a Cartesian coordinate system It represents the direction at which the rate of change of the phase is maximum 13 2 3 Wavefronts 18 2 3 1 The Plane Wave One of the simplest solutions of the Helmholtz equation in a homogeneous medium is the plane wave Using V k U r 0 we have U U AU m op 88 M QE 2 34 Let U r f x g y h z substitute this expression into equation 2 34 and divide by U r IAE ara Fran Pf o f x g y h z f g h f x s h z flag l ICE c9 a RUE go fc gu IS Id Let f f kz g g k and h h k2 therefore we can state the following relations k2 ke k k 2 36 P Gn k2f x 0 2 37 fay kg y 0 2 38 ee k2h z 0 2 39 When solving for the differential equations 2 37
208. todiode involving amplification and noise removal head 33 Since one revolution of the high precision XY stage corresponds to a linear translation of 0 5 mm the minimum vibration displacement that can be achieved is about 4 07e 05 mm which is less than 0 0001 mm Furthermore two PWM signals with a frequency of 330 Hz and 50 duty cycle generated by a Dragon 12 68HCS12 microcontroller by means of a Dual H bridge are used to drive the X and Y motors The 48 pts rev rotary encoder signals are fed back to the microcontroller to obtain the position measurements The x and y positions are sent to the PC serially with a baud rate of 115 2 kbits s The power and position measurements are acquired synchronously every 1 s for one complete travel range of the Y motor while keeping the X motor fixed at a certain distance 4 3 Experimental Study of the Position Detector 74 Photo Voltage V 4 L L L L L L L L L 0 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 1 Time s Figure 4 22 Plot of photocell output voltage in darkness 0 9 0 8r 4 0 7r 0 6r 0 5r 0 4 Photo Voltage V 0 3 0 2r 4 0 17 4 0 I I L L 1 I L L L 0 0 01 0 02 0 03 0 04 0 05 0 06 0 07 0 08 0 09 0 1 Time s Figure 4 23 Plot of photocell output voltage in ambient light when no laser beam is applied 4 3 2 Optical Model Validation Using the data illustrated in Figure 4 22 the calculated RMS
209. tral media whether dielectric or conducting Therefore by replacing E with the optical wave u r t and setting u Ho to the magnetic permeability in free space and e e to the electric permeability in free space and E 0 we end up with the following wave equation for an optical wave Ou r t V u r t loto 2 20 r t nets a5 2 20 1 v HoEo optical signal propagating in free space as follows 13 Since the speed of light c we can finally state the wave equation for an 1 O u r t V u r t 2 gz 2 21 2 2 Monochromatic waves 14 2 2 MONOCHROMATIC WAVES A mononchromatic wave is represented by a wavefunction with harmonic time depen dence u r t a r cos 27 ft y r 2 22 Where a r amplitude y r phase f frequency cycles s or Hz and w 27f angular frequency radians s Both the amplitude and the phase are generally position dependent but the wavefunction is a harmonic function of time with frequency f at all positions 13 2 2 1 Complex wavefunction It is convenient to represent the real wavefunction u r t in equation 2 22 in terms of a complex function U r t a r exp jo r exp 2n ft 2 23 such that u r t Re U r t U r t U r t 2 24 N The function U r t also known as the complex wavefunction completely describes the wave and the wavefunction u r t is simply its real part Si
210. uch as vibration exciters or shakers 2 Vibrations have been mainly detected by contact and noncontact type sen sors for measuring displacement velocity or acceleration 4 Conventional vibration sensors such as potentiometers or linear variable differential transformers LVDTs piezoelectric accelerometers and strain gauges are common in practice Contact type sensors such as potentiometers and strain gauges are used to sense displacement ei ther by making physical contact with or attached to the object of interest However in some cases physical contact may not be practical in terms of impeding or altering the natural behavior of the device or inability to install them in hard to reach places or when the object is fragile and prone to damage 5 Moreover potentiometers have the following limitations 1 High frequency or highly transient measurements are not feasible because of factors such as slider bounce friction and inertia resistance and induced voltages in the wiper arm and primary coil 2 Resolution is limited by the number of turns in the coil and by the coil uniformity 3 Wear out and heating Introduction 3 up with associated oxidation in the coil and slider contact cause accelerated degrada tion 2 Another extensively used vibration sensor is the piezoelectric accelerometer an electromechanical device where its output voltage is proportional to an applied vibratory acceleration Although it is light in wei
211. up x UnimplementedISR vector 35 FLASH x UnimplementedISR vector 34 EEPROM x UnimplementedISR vector 33 SPI2 UnimplementedISR vector 32 SPI1 x UnimplementedISR vector 31 IIC bus UnimplementedISR vector 30 DLC x UnimplementedISR vector 29 SCME x UnimplementedISR vector 28 CRG lock x UnimplementedISR vector 27 Pulse accumulator B overflow x Appendix D Microcontroller Code 198 UnimplementedISR vector 26 Modulus down counter underflow x UnimplementedISR vector 25 PORT H x UnimplementedISR vector 24 PORT J x UnimplementedISR e vector 23 s ATDI UnimplementedISR vector 22 ATDO x SCIl_isr vector 21 SCIT TIE TCTE RIE TLIE UnimplementedISR vector 20 SCIO TIE TCIE RIE ILIE x UnimplementedISR vector 19 SPIO x UnimplementedISR vector 18 Pulse accumulator input edge x UnimplementedISR vector 17 Pulse accumulator A overflow x OV F ISR vector 16 Timer Overflow TOF x UnimplementedISR vector 15 Timer channel 7 x UnimplementedISR vector 14 Timer channel 6 x UnimplementedISR vector 13 Timer channel 5 x UnimplementedISR vector 12 Timer channel 4 x TIC2ISRY vector 11 Timer channel 3 x TIC2ISRX vector 10 T
212. us the pages of the 3D array become the columns of a 2D matrix and the columns of the 3D array become the rows of the 2D matrix Therefore for this case we have gt gt F F 0 0 5000 0 7500 0 0 5000 0 2500 0 0 0 2500 0 0 0 7500 gt gt G G 1 0000 0 5000 0 2500 0 0 5000 0 2500 0 0 0 2500 0 0 0 2500 Let us further define the following parameters pf qf find F 0 pg ag find G 0 where pf and qf are the row and column indices where an element of F is not equal to zero Moreover pg and qg are the row and column indices where an element of G is not equal to zero For this example we have 1 WN Initialization 164 gt gt pf af ans E 2 2 2 ae 3 2 3 3 3 4 3 gt gt pg q9 ans 1 1 1 2 2 2 1 3 2 3 3 3 4 3 Next we need to extract the initial translation and dilation parameters from the matrices F and G such that mai F 1 1 m F 1 2 mai F 2 2 mMm ma FA 3 Ms F 2 3 mei F 3 3 mn F 4 3 1 WN Initialization 165 and G G G di dy G G G G To do that we first run the following for loops to generate the row vectors s and t which consist of the nonzero elements of F and G for w 1 length pf s w F pf w qf w end for w 1 length pg t w G pg w ag w end Since m4 F 1 1 is zero in this example the following if statements need to be applied if F 1 1 0 m 1 F 1
213. view of beam optics wavelets and wavelet networks WN and their use in function approximation Next in Chapter 4 we describe the design of our proposed system which involves the system architecture of the theoretical optical acquisition model of the position sensor We also present the experimental setup and results used to validate the theoretical optical model Finally in Chapter 5 we discuss the results obtained after training and testing the WN Beam Optics The optical signal emanating from the He Ne laser source is commonly modeled as a Gaussian beam traveling in free space whose intensity varies with the propagation distance z and the radius of the beam p measured from its center As the laser beam propagates its power remains constant but its intensity decreases with an inverse square law This behavior is important to consider in the theoretical model of the proposed system as well as the design of the experimental setup because the power intercepted by the photodetector depends on the area of the detector active surface In this Chapter we will discuss the propagation of light in free space that would lead us to the derivation of Gaussian beam optics intensity and power characteristics 2 1 THE WAVE EQUATION Light propagates in the form of waves In free space light waves travel with speed Co A homogeneous transparent medium such as glass is characterized by a single constant its refractive index n gt 1 In a medium
214. wer at y 0 83 cm and y 0 70 cm The voltage percentage error for the preceding cases was 20 7 for photocell 1 and 26 296 for photocell 2 Photocells 3 and 4 gained maximum optical power at y 0 42 cm and y 0 74 cm where their relative voltage percentage errors were evaluated to be 28 8 and 23 3 Figures 4 24 4 25 and 4 28 demonstrate discrepancies between the theoretical and experimental results in the values of the photo voltage or optical power 4 3 Experimental Study of the Position Detector 77 0 7 T T T T T T I n P1 o P2 P3 0 6r o P4 o e w ES a Photo Voltage Vo V 2 Dy 0 1 Figure 4 24 Plot of photocell output voltage vs y position of the center of the beam while setting the x position at 1 05 cm 0 5 0 45 Photo Voltage Vo V o o o an o io o w e al Po al wo al Az eo m 0 05 Figure 4 25 Plot of photocell output voltage vs y position of the center of the beam while setting the x position at 1 05 cm 4 3 Experimental Study of the Position Detector 78 0 9 Photo Voltage Vo V o o o o o o wo Az al o N 00 e Dy 0 1 Figure 4 26 Plot of photocell output voltage vs y position of the center of the beam while setting the x position at 0 55 cm 0 9 Photo Voltage Vo V o o o o o o wo Az al o N 00 e Dy 0 1 2 1 5 ES 72 93 30 205 T S 2 Figure 4 2
215. work Q Zhang and A Benveniste in 23 20 24 proposed to combine both wavelets and neural networks This new type of network by the name of wavelet network WN is presented in 23 as a class of feed forward networks composed of wavelets which act as activation functions replacing the traditional sigmoidal functions The basic idea is to use more powerful computing units obtained by cascading wavelet transform as an alternative to neurons The WN merges the good localization properties of wavelets with the approximation abilities of neural networks In addition the wavelet network learning is performed by the standard back propagation type algorithm as in the conventional feed forward neural network 19 3 2 NEURAL NETWORKS In this section a brief overview of neural networks and their structure will be provided Let O be a set containing pairs of sampled inputs and the corresponding outputs 3 2 Neural networks 32 generated by an unknown map f R R m n lt oo such that O 2 y yP f 2P R em8 1 Np Np lt We call the training set The task of functional approximation is to use the data provided in to learn or approximate the map f Numerous existing schemes to perfom such a task are based on parametrically fitting a particular functional form to the given data Simple examples of such schemes are those which attempt to fit
216. yn xint yint xo yo c px isreal xint Check if there is intersection x coordinate py isreal yint Check if there is intersection y coordinate Ac pi r 2 SArea of circle with radius r se se Case 1 No intersection between circle and square OR just touching if px 0 amp py 0 length yint 1 Area 0 elseif px40 amp pyx0 Case 2 Centre of circle greater than or equal to yo upper side of square if yn gt yo d yn yo beta asin d r Area r 2 2 pi 2 beta sin 2xbeta Case 3 Centre of circle less than or equal to yo lower side of square elseif yn lt yo d yo yn beta asin d r Area r 2 2 pi 2 beta sin 2xbeta Case 4 Centre of circle between 0 and yo upper half of square elseif yn 0 amp yn lt yo Appendix A Matlab Codes 119 d yo yn beta asin d r Al r 2 2 pi 2xbeta sin 2 beta Area Ac Al Case 5 Centre of circle between yo and 0 lower half of square elseif yn lt 0 amp yn yo d yo yn beta asin d r Al 172 2 x pi 2xbeta sin 2x beta Area Ac Al end end Appendix A Matlab Codes 120 o o o o o o o o o o o o oe oe o o o o o o AP AL AL AL AP AL oe oe o o9 o9 o9 o9 o AL o AL AL AL AY AY oe o oe o oe o oe o oe o oe oe oe o oe o oe o oe o oe o oe o oe oe oe o oe oe oe o oe oe oe o oe Function eircular Center o and y ax origin o Given diameter of the circul
217. yo amp dx xn xo dy yo yn elseif xn xo amp yn yo dx xn xo dy yo yn elseif xn xo amp yn lt yo dx xn xo dy yo yn elseif xn lt x0 yn yo dx xn x0 dy yo yn elseif yn lt yo amp xn lt xo dx xo xn dy yn yo elseif yn lt yo xn xo dx xo txn dy yn yo elseif yn yo amp xn lt xo amp dx xo xn dy yn yo elseif yn yo amp xn xo dx xo txn dy yn yo elseif xn xo amp xn gt 0 amp dx xo xn dy yo yn elseif xn gt xo amp xn 0 dx xo txn dy yo yn oving along the y axis only r xn yn xint yint xo yo Cc oving along the x axis only r xn yn xint yint xo yo Cc oving along both x and y axis sRegion 1 sRegion 2 Region 3 sRegion 4 yn 0 SRegion 5 amp yn lt 0 Region 6 amp yn 0 SRegion 7 amp yn lt 0 SRegion 8 amp xn 0 Region 9 amp xn lt 0 SRegion 10 xn 0 SRegion 11 amp xn 0 sRegion 12 yn lt yo amp yn gt 0 Region 13 amp yn lt yo yn gt 0 SRegion 14 Appendix A Matlab Codes 130 elseif xn xo xn lt 0 amp yn yo yn 0 SRegion 15 dx xo txn dy yotyn elseif xn xo amp xn gt 0 amp yn yo amp yn 0 Region 16 dx xo xn dy yotyn end alphal asin dx r alpha2 pi alphal betal asin dy r beta2 pi betal phi atan dy dx kx 2 W 2 xdx 2 ky 2 W 2 xdy 2 Qx alpha exp kx sin alpha

Download Pdf Manuals

image

Related Search

Related Contents

IC-F5120D series SERVICE MANUAL  Some Examples of What We (Absolutely) Need  Gas Cooktop LP Conversion Kit 806077 PTS 17000000    Tecumseh AWG5515EVA Drawing Data  # zep doc 2002 support n&b (Page 1)  Hitachi CB6Y Saw User Manual  Samsung GT-I5800 Manual de utilizare(Eclair)  Manual do Usuário  Benq MX823ST data projector  

Copyright © All rights reserved.
Failed to retrieve file