romainbrette / clampy

4 stars 0 forks source link

Automatic tuning #4

Closed romainbrette closed 2 years ago

romainbrette commented 5 years ago

We need some methods to automatically adjust bridge and voltage-clamp tunings.

romainbrette commented 5 years ago

What can be automated:

First step:

romainbrette commented 5 years ago

For the TEVC, there's a PID autotuning library we might be able to use. A classic rule is Ziegler-Nichols. It's based on increasing the gain until we see an oscillation, ie just before it becomes unstable. In fact perhaps we can even use the amplifier oscillation detector.

romainbrette commented 5 years ago

The Z-N rule is the following: measure the gain G at oscillation and the period T of the oscillation. The tunings are: gain = 0.8*G; phase lag = T/8.

romainbrette commented 2 years ago

I have implemented it with pyautogui. It works simply by using the oscillation detection feature, and bisection. Then selects 0.8*C, where C is the critical capacitance. This should be fine in the bath, maybe not so much in the cell.