Can I use PID to maximize a detector signal?

  • Thread starter Galoot44
  • Start date
  • Tags
    Led
  • #1
Galoot44
8
0
TL;DR Summary
I want to use an Arduino to control 2 motors to steer a mirror to focus light on a detector.
I'm trying to get back to doing engineering work and I want to make an optical alignment jig and put the project on my LinkedIn page. I want to have a small spherical mirror focus light from an LED onto a silicon detector. I'd like to try using PID to make it work quickly. When I read about PID control it talks about reducing an error signal to zero. That seems different than steering a mirror to maximize the light hitting a detector. Is PID control the right solution for this? Thanks!
 
Engineering news on Phys.org
  • #2
Welcome to PF.

What kind of "DC Motors" are you wanting to use? Stepper, Servo, other? What is your background in feedback and control so far? Do you know what "dithering" is and what it can be useful for? :smile:
 
  • #3
Two stepper motors that came with my Arduino Uno kits. I have done very little with feedback and control. I'm taking a Udemy course on PID control that a colleague recommended: https://www.udemy.com/course/pid-control-with-arduino/learn/lecture/10009562#overview

Dithering? I'm somewhat familiar with the idea. I'm unsure about how any of this addresses my main question, which is whether PID is appropriate for an optical alignment task.
 
  • #4
I assume you want to aim at the target.
What sensor will you use?
Will you also detect the focal length and correct that?

If you sweep a beam across a point detector and record signal strength, when centred over the detector you will get a symmetrical signal with the peak at the centre, if to one side you will get a slope with the high side towards the target. When on target, the signal will have minimum fundamental sweep frequency, but the maximum second harmonic of sweep frequency in the signal. Do that independently to all mirror axes to optimise alignment.
 
  • Like
Likes berkeman and Galoot44
  • #5
I haven't selected a sensor yet, probably a simple silicon photodiode run in PV mode. And no I won't correct the focal length. I might do what you suggest and do a grid scan and analyze that as you suggested. No PID needed in that case.
 
  • #6
Galoot44 said:
I haven't selected a sensor yet, probably a simple silicon photodiode run in PV mode.
Tip -- Reverse bias your detector to get better BW and improve phase margin...
 
  • Like
Likes Galoot44
  • #7
Standard stepper motors may be too coarse for this. Are they possibly micro-stepper motors?

It's probably worth some initial experiments using manual control via the Arduino to see what kind of spatial resolution you can achieve with the stepper motors and mirrors and your photodetector. Have you tried that yet?
 
  • #8
I talked to the colleague who did this years ago--he confirmed that he used a grid scan, not PID. So I'll do that. For my PID project I'm going to control a thermo-electric cooler but with op amps instead of an arduino. There is a good guide here https://www.analog.com/en/technical...d-compensate-a-thermoelectric-cooler-tec.html

But I am confused about a symbol found in several places on the schematic:
1698861185053.png


What is that THERM symbol? In the other uses it appears to be some way of adjusting something. Thanks for the help!
 
  • #9
They look like test points to me. Is there an image of the circuit that you can look at to see if there are little metal probe tips sticking up at those locations?
 
  • #10
No image of the circuit Test points make perfect sense, thank you! This is going to be a really fun project to build.
 
  • #11
Galoot44 said:
This is going to be a really fun project to build.
BTW, there is an error in the input circuit for U3. Can you figure out what it is? (Kind of weird for AD to make an error like that...)
 
  • #12
The feedback has no resistor! It goes straight from the output to the negative input of U3. Weird.
 
  • #13
Galoot44 said:
The feedback has no resistor! It goes straight from the output to the negative input of U3. Weird.
No, that part is okay. It's a common unity-gain buffer configuration for an opamp...
 
  • #14
OK, I gave away my copy of Horowitz and Hill so my reference source for op-amps is no longer available. So I have no idea.
 
  • #15
Galoot44 said:
OK, I gave away my copy of Horowitz and Hill so my reference source for op-amps is no longer available. So I have no idea.
Funny you should mention H&H -- we discussed this issue in an old thread about the "Bad Circuits" in H&H:

https://www.physicsforums.com/threads/bad-circuits-test-your-knowledge.178516/post-1390820

The issue is that when you have almost no wiper current for a potentiometer, the contact corrodes over time and the pot setting becomes unreliable. Pots will specify a minimum wiper current to keep them reliable over time, so any time you see a pot wiper going straight into an opamp input, you need to check the input bias current spec in the datasheet to see how it compares to that minimum wiper current.

I checked the spec for the opamp that AD is recommending in that app note, an its input bias current is in the pA range. :wink:

BTW, the Bourns Potentiometer Handbook discusses this issue, as well as giving all kinds of useful tips:

https://www.bourns.com/pdfs/OnlinePotentiometerHandbook.pdf
 
  • Like
Likes Galoot44
  • #16
"corrodes over time" isn't a huge concern for me but if you have a correction to make to the circuit I would welcome it. I'm going to build this, take a video of it working to put on LinkedIn, then take it apart.
 
  • #17
You should be able to find alternative configurations of pots to minimize this problem in that Bourns Handbook that I linked to. There are several ways to configure such a circuit with a pot and a couple of resistors to eliminate the problem.

And yeah, if you're going to put this on LinkedIn as an example of your work, you will definitely want to fix that before posting. I think most analog EEs would spot that issue.
 
  • Like
Likes Galoot44
  • #19
The classical solution to tracking (or peak finding) circuits is to use coherent detection of a dither perturbation in 2 orthogonal dimensions (typically called I & Q, in-phase and quadrature phase). Coherent detection is essentially the same as using "lock-in amplifiers". The dither signal will scan in a circle around the current "best guess" position. One channel will optimize North-South, the other East-West. Of course there are both analog and digital implementations, dating from WW2 radar to the cell phone in your pocket.

Here is a good introduction:
https://www.zhinst.com/americas/en/resources/principles-of-lock-in-detection
 
  • Informative
Likes berkeman
  • #20
Another interesting aspect of the circuit is no DC feedback around U1.

The overall circuit appears to function as Bang-Bang (hard on - hard off), PID controller.

Either clever or another case of a Bad Schematic.

@Galoot44, please let us know how well it works, some oscilloscope traces of the TEC voltage or current during operation would be especially useful.

Cheers,
Tom
 
  • #21
Tom.G said:
Another interesting aspect of the circuit is no DC feedback around U1.
Yikes, I missed that. The path U3 output -->U2-->U1 inverting input looks problematic. If I had the time I'd try simulating it, but maybe your bang-bang guess is correct.
 
  • #22
Tom.G said:
Another interesting aspect of the circuit is no DC feedback around U1.
This is normal in a closed loop controller. It's an integrator which is designed to eliminate DC errors, using (nearly) infinite gain. The DC feedback mechanism is the temperature of the oven (make heat -> measure temperature).
 
  • Like
Likes Tom.G
  • #23
Tom.G said:
The overall circuit appears to function as Bang-Bang (hard on - hard off), PID controller.
I don't think this is a bang-bang controller.
U2 generates a target voltage for 'therm'. The error voltage is amplified, then after passing the U1 PID controller, goes to the voltage input of the MAX1968.
The MAX1968 is a voltage controlled, high efficiency, switching, bidirectional current source, for the thermoelectric cooler/heater element, it has additional inductive components, not shown in the post #8 diagram.
 
  • Like
Likes Tom.G

1. What is a PID controller and how does it relate to maximizing a detector signal?

A PID (Proportional, Integral, Derivative) controller is a type of feedback loop mechanism widely used in industrial control systems to maintain a desired output level. In the context of maximizing a detector signal, a PID controller can adjust process variables to optimize the signal strength, ensuring the detection system operates at its most effective level. This is achieved by continuously calculating an error value as the difference between a desired setpoint and a measured process variable (in this case, the detector signal) and applying corrections based on proportional, integral, and derivative terms.

2. Can PID controllers be used for any type of detector signal?

PID controllers are versatile and can be adapted to many types of detector signals, provided that the system's dynamics are well-understood and the signal behaves in a predictable manner. However, their effectiveness can vary depending on the specific characteristics of the signal, such as linearity and noise level. For highly nonlinear systems or systems with high levels of noise, modifications to the basic PID algorithm or alternative control strategies might be necessary.

3. What are the challenges of using PID controllers for signal maximization?

One of the main challenges in using PID controllers for signal maximization is the proper tuning of the controller parameters: the proportional, integral, and derivative gains. Incorrect tuning can lead to instability, oscillations, or slow response of the system. Additionally, PID controllers might struggle with systems that have significant delay, high noise levels, or where the signal response changes over time, requiring adaptive or more complex control strategies.

4. How do I tune a PID controller to maximize a detector signal?

Tuning a PID controller involves setting the proportional, integral, and derivative gains to achieve the best performance in terms of response time, stability, and minimal overshoot. Common methods for tuning include manual tuning, where adjustments are made based on trial and error; Ziegler-Nichols method, which provides a set of empirical rules based on the system's open-loop response; and software-based optimization techniques that can automate the tuning process by simulating different settings and evaluating performance.

5. Are there any alternatives to PID control for maximizing detector signals?

Yes, there are several alternatives to PID control that might be better suited for certain applications. These include advanced control strategies like Model Predictive Control (MPC), which can handle multivariable systems and constraints more effectively; adaptive control, which adjusts its parameters in real-time to cope with changes in system dynamics; and machine learning approaches that can learn optimal control strategies from data. The choice of control strategy depends on the specific requirements and constraints of the application.

Similar threads

  • Electrical Engineering
Replies
3
Views
1K
Replies
3
Views
5K
Replies
37
Views
3K
  • DIY Projects
Replies
22
Views
3K
Replies
13
Views
3K
Replies
8
Views
7K
Replies
1
Views
2K
  • Atomic and Condensed Matter
Replies
5
Views
2K
  • Electrical Engineering
Replies
1
Views
1K
Replies
62
Views
3K
Back
Top