LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Best continuous heuristic optimization?

I'm trying to find a physical global maximum using a 3-axis piezo stage (lasers if you're interested) which has real bad hysteresis, meaning I can't jump from one point in space to another without loosing my position. So I need some kind of continuous meandering or spiraling way to find my maximum. Any recommendations? I would really appreciate it, thanks!

0 Kudos
Message 1 of 18
(3,465 Views)

Hi nirakara,

 

Are you planning on using LabVIEW to create your optimization model?

 

Best Regards,

Andrew S.

Application Engineering Specialist
National Instruments
0 Kudos
Message 2 of 18
(3,447 Views)

Indeed it would be silly to post here if I wasn't, but yes we use labview for all of our controls. And not to name names but our stages are from thorlabs.

0 Kudos
Message 3 of 18
(3,432 Views)

Doesn't seem that anyone is responding with suggestions so I guess I'll take a swing. I've never done anything related, but I'd be happy to try and help if you could provide more details on your project, hardware involved, and implementation. If you already have code, a screen shot of your block diagram would help to visualize your algorithm, and take this conversation from a very high level to the nuts and bolts. Plus more discussion might elicit responses from others who may have more of a clue.

Application Engineering Specialist
National Instruments
0 Kudos
Message 4 of 18
(3,410 Views)

While we are at a high level, are you using a PID controller and do you have our Fuzzy Logic Toolkit? That could be a start.

 

Andrew S.

Application Engineering Specialist
National Instruments
0 Kudos
Message 5 of 18
(3,401 Views)

Thanks for the offer to help, I really appreciate it. Our current labview program is too large to post (40 screenshots at least) but what we would like is not an improvement, but a replacement of our algorithm. The program is an automated, mechanically-positioned fiber testing system, which means an optical fiber gets positioned over a source of light, a photodetector takes a reading and then does it again, over and over. Every time we roughly position the fiber it needs to be finely positioned to find the highest point of light, and this it the time consuming part. 

 

This is what we move with labview (program output) -> http://www.thorlabs.com/NewGroupPage9.cfm?ObjectGroup_ID=2386

This is what we read data from (program input) -> http://search.newport.com/?q=*&x2=sku&q2=2936-C

This is what the data looks like (approx) -> http://matt.eifelle.com/wp-content/uploads/2009/12/3d-sinc2d.png

 

In detail this is the process for fine tuning currently:

- Move the stage over one axis in very small steps

- Every step take one measurement

- Look at full curve and reposition stage to highest point

- Repeat for next 2 axis

- Repeat all 3 axis (there might be false maximum points)

 

What we would envision as better would be something that steps through all 3 axis at once, and moves in the general direction of the maxima. Does that makes sense? It's been very hard to find so far...

0 Kudos
Message 6 of 18
(3,394 Views)

Andrew,

 

It seems we have the PID and Fuzzy Logic toolkit, but we have not used it, nor are we using any feedback system with these stages at all. 

 

This is the stage controller we use -> http://www.thorlabs.com/NewGroupPage9.cfm?ObjectGroup_ID=1098

 

It does return a voltage if you ask it but we believe the problem is at the stage level, not the controller. This is not new by the way, we know of several research groups which have similar problems with these stages, even with closed loop systems. This is why we're looking for something that moves continuously. 

 

 

0 Kudos
Message 7 of 18
(3,393 Views)

Hi Nirakara,

 

I do not have any specific ideas of how to optimize your maximum search with the limited information but the documents below might be a good starting point, please read through them and see if they help. Keep in mind the points that are brought up in your other post and look through that book that you posted.

 

Improving PID Controller Performance
http://zone.ni.com/devzone/cda/tut/p/id/7438


Robotics Fundamentals Series: Self Optimization
http://zone.ni.com/devzone/cda/tut/p/id/8226


Best continuous heuristic optimization algorithm?
http://www.reddit.com/r/math/comments/qy95k/best_continuous_heuristic_optimization_algorithm/

 

Tim O

Applications Engineer
National Instruments
Message 8 of 18
(3,375 Views)

Two ideas:

First, use a much coarser grid in your current algorithm for each of the 1D axis optimizations.  Instead of your current "very small step" (call this delta_p) use 10*delta_p as the step.  Then use peak detection or fitting to estimate the actual peak location and position the stage to this point.  Repeat for next axis, etc..  Then cycle through the axes again, using a subset of each axis range and a finer grid.  You might need to cycle through the axes a few times, but ultimately this might require less measurements.

 

Second:

This sounds like an optimization problem, but instead of an objective function coded in software you have the objective function in hardware.  If you created a VI that takes as input the position (x,y,z) and outputs the photodetector reading then you have an objective function that can be passed to an optimization algorithm (Mathematics palette->Optimization->Unconstrained optimization.vi).  There are a few caveats.  First, make sure to negate the photodetector reading so that the problem is a minimization instead of a maximization.  The Quasi-Newton and Conjugate Gradient algorithms require gradients, and attempt to compute them numerically if you don't output them from the objective function.  Your stage probably has limited resolution in movement, and so may not be able to move the minute amount the algorithm is requesting.  Because of this you could either choose the Nelder-Mead simplex algorithm (no derivatives required), or make sure that you compute the derivatives explicitly by moving the stage a small amount in each axis and estimating the gradient.  Nelder-Mead is considered pretty robust, and might be your best bet given the hysteresis of your stage.

 

-Jim

Message 9 of 18
(3,368 Views)

Thanks for your suggestions Jim, in fact I've tried several of your suggestions already. We do in fact use the coarse scan/fine scan approach and it helps a bit. We've also made a simplex algorithm. They all work but are simply limited by not being able to apply a voltage and go back to a previously measured position. Nelder-Mead for example takes very few measurements, but they are all scattered across the space, and if I move my stage in anything less than 0.1 volt steps (range is 75) then I can't find my original positions again. So then I end up doing a lot of fine scans moving from point to point.

 

This is why I think some kind of continous hill-climbing method is the only recourse left to me, but I'll look into this Unconstrained optimization.vi, thanks!

0 Kudos
Message 10 of 18
(3,360 Views)