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

FAQ: Can I use PID to maximize a detector signal?

What is PID control?

PID control stands for Proportional-Integral-Derivative control. It is a type of feedback control system that uses a combination of three terms—proportional, integral, and derivative—to continuously adjust the output in order to minimize the error between a desired setpoint and the measured process variable.

Can I use PID control to maximize a detector signal?

Yes, PID control can be used to maximize a detector signal. By setting the detector signal as the process variable and defining an appropriate setpoint, the PID controller can adjust the system's input parameters to optimize the detector signal.

How do I tune the PID parameters for maximizing a detector signal?

Tuning the PID parameters involves setting the proportional (P), integral (I), and derivative (D) gains to values that achieve the desired control performance. This typically requires iterative testing and adjustments. Methods such as Ziegler-Nichols, trial and error, or software-based auto-tuning can be used to find optimal values.

What are the challenges in using PID control for detector signal optimization?

Challenges include accurately modeling the system dynamics, dealing with noise in the detector signal, and managing the trade-off between response speed and stability. Additionally, non-linearities in the system can complicate the tuning process.

Are there alternatives to PID control for maximizing a detector signal?

Yes, there are alternatives to PID control, such as adaptive control, model predictive control (MPC), and fuzzy logic control. These methods can offer better performance in systems with complex dynamics or where PID control is difficult to tune effectively.

Back
Top