-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtuning.txt
More file actions
32 lines (20 loc) · 2.69 KB
/
tuning.txt
File metadata and controls
32 lines (20 loc) · 2.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Parameter Tuning
================
The parameters that control the sensitivity of the subparts of the control-loop, p and i, have to be calibrated to the system (interferometer) under control.
As mentioned in the README.txt, against some aesthetical considerations, these parameters are hard-coded in the 'locking' sketch. You could change that e.g. by using potentiometers to adjust them. As it is now, you need to adjust them in the code and re-upload the code to the microcontroller to observe the effect of your changes.
For observation, you should connect your microcontroller to your PC and open the serial plotter. It plots four values:
PD_goal is the setpoint; the desired voltage of the photodiode you want your interferometer to be locked to.
PD_act is the actual reading of the photodiode; it should stay close to PD_goal, while the locking is active.
PZ corresponds to the voltage feeded to the piezo. It is an integer in 0..255 and ideally is around 128 to keep scope in both directions. PZ is written to the Pin 9 via the analogWrite() function.
average is the basis for the integral part of the control loop: it is the average error over the last 20 readings.
While tuning the control parameters, we need to moderately disturb the system multiple times. For an interferometer this is most easily done by pushing downward on its breadboard (ground plate) at some point as the induced stress should be enough to move the pattern up to multiple fringes.
This procedure can be followed to tune the parameters:
- First you set both parameters (p - proporional and i - integral) to zero.
- Then you increase p until a perturbation of the system gets compensated relatively quickly to a stable point without too much overshooting.
- Now you increase the i until a perturbation gets compensated quickly to the desired level, without too much overshooting.
- If this is not possible, you may need to slightly decrease p and increase i further.
Operation
=========
One of the drawbacks of our very simple setup is that we can not drive the piezo very far since our possible voltages applied only span about 5 V. Typically that only allows to shift the pattern by only very few fringes. Great disturbances can therefore not be fully compensated. It happens after a while or through too heavy impacts that the microcontroller reaches its limit of possible compensation. With the code as-is it typically gets stuck there and the Arduino needs to be resetted by its reset-button to get back to locking the interferometer.
You could of course modify the code, to automatically detect being stuck at maximum (or minimum) displacement and define some desired behaviour.
An amplifier could help in moving the piezo further than just a few fringes.