LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Grating Coupler from fiber to chip fully automatic control on Labview

Hello Engineers,

 

I am actually working on this project:  Development and implementation of an algorithm for automatic grating coupler from fiber to chip

 

So, the idea for the alignment is the conventional alignment approach based on the "Hill climbing Algorith".

I want to know how to built a VI to run this algorithm? Which tools I need for this purpose?

 

I will use this materials: Powermeter ( for the acquisition of the transmitted power value) , 2 stages of piezo controllers from " Thorlabs"( contain step-servomotors to move the 3- axis : X,Y and Z) in order to reach the maximum power value to optimaze the coupling, GUI on Labviw (shows the real time measurements and other informations: axis value, power value max and min ...)

I want to use the Hill climbing  algorithm to search the maximum transmitted power value that´s mean the optimal coupling from fiber to chip.

 

I need some help please such as a Start VI. or some graphical design and how can I implement the Climbing algorithm on Labview?

 

Thank you for your response

0 Kudos
Message 1 of 22
(3,084 Views)

J.Badr.TU.Braunschweig,

 

If I had a project like that, I would probably start with a program that does some third party acquisition and plots it in real-time using a producer/consumer architecture. For example, you could start with the Temperature Monitoring example (Help -> Find Examples… in LabVIEW, Go to Browse tab, look under Industry Applications folder). This will give you a good starting architecture. Change out the "Simulate Temperature Acquisition vi" inside the third loop to whatever VI your hardware uses to acquire or change external stimuli. You may have to change the waveform chart to something more specific to your application. Once you've swept all the parameters, you'll need to check which input value gave you the most optimal output. How you decide to do this will be highly dependent on your own coding decisions though.

 

If you would like more information on the producer/consumer architecture, check out this link: http://www.ni.com/white-paper/3023/en/

0 Kudos
Message 2 of 22
(3,042 Views)

thank you for the response.

 I´m actually able to read the power from the powermeter (Agilent 8163B) [similar to the temperature exemple] using visa instrument but i have now a problem , the ´read buffer of the ´visa read´ shows the value of the real power in type string however i need to convert it to double  . I have tried Fract/exp string but the same problem appears it shows only values between 0 and -9,9999 if it exceeds this value it returns to 1. for example the value displayed on the powermeter´s screen is -15,362548 dBm ===> the buffer read is  -1,362548 !!!!

any solution please? 

0 Kudos
Message 3 of 22
(2,992 Views)
0 Kudos
Message 4 of 22
(2,990 Views)

this is the code

0 Kudos
Message 5 of 22
(2,987 Views)
  1. You should not Open and Close the VISA connection at EVERY iteration! You open it ONCE before the While loop, and Close it ONCE after the While loop!
  2. What do you use as communication? GPIB or RS232? Maybe the recent VISA Open settings are not optimal (but this nothing to do with the "wrong reading" of the measurement value)...? You should also limit the read outs in your While loop so you do not poll your device too fast (put a 1000 msec Wait into your loop).
  3. About the "reading of power value". What you write is really confusing. You say you have problem converting the incoming string to a numeric value, but after this you also say the reading in the Text indicator is also wrong.

I attached the programming manual in pdf. Go to page 87. Read the description of the

fetc1:pow?

command:

Spoiler
It returns the value the previous software trigger measured. Any subsequent FETCh command
will return the same value, if there is no subsequent software trigger.

So you need a software trigger I guess?

 

 

0 Kudos
Message 6 of 22
(2,978 Views)

A few remarks...

 

Your closing the VISA session in the loop. That means the session is only valid the first iteration, and then never after. Usually you open once, repeat the reading, then close the session when done.

 

You read 8 bytes. That might make perfect sense, but it would be much better to program VISA to use end characters. I'm pretty sure SCPI uses \n as end termination character. That way, it will work for all commands.

 

The string to double conversion seems OK to me. Can't run your code, but if I change the indicator to control, I type -15,362548 dBm, and I get -15,362548 alright. Note that the "," might be the problem, but you'd get -15.00. Set use system decimal point to false, as the device will always return ".", not ",". I don't see how it would ever return -1,362548.

0 Kudos
Message 7 of 22
(2,972 Views)

Yep, based on the OP's name, he is from Germany, and the German decimal sign (,) often ruins things. Over the last years my German colleagues learned that if they want to get help from me, they should use English Windows and English LabVIEW 😄

(I know that you can change the decimal sign in the Region settings, or you program this around in LabVIEW)...

0 Kudos
Message 8 of 22
(2,970 Views)

@Blokk wrote:

Yep, based on the OP's name, he is from Germany, and the German decimal sign (,) often ruins things. Over the last years my German colleagues learned that if they want to get help from me, they should use English Windows and English LabVIEW 😄

(I know that you can change the decimal sign in the Region settings, or you program this around in LabVIEW)...


Programming LabVIEW in Europe 101:

1) Use %.; in format to string and scan from string,

2) set "use system decimals" to false.

 

When dealing with files, databases, etc.. When you output a string to the used, you should use what the uses choose, e.g. the system decimal point. Very confusing the first few programs you make.

 

There is an option in LabVIEW to globally ignore the system settings (always use "."), but really everyone should just use 1) and 2). Everyone, not just everyone in Europe.

0 Kudos
Message 9 of 22
(2,963 Views)

I'm using GPIB communication .

I corrected the visa open and visa write outside the loop now the conversion works.

 Then I think the problem of reading wrong measurment is in the 'visa write'  command "fetc1: pow?"

i already had have the manual for the device and it can be related to the trigger!

 

0 Kudos
Message 10 of 22
(2,962 Views)