40m QIL Cryo_Lab CTN SUS_Lab TCS_Lab OMC_Lab CRIME_Lab FEA ENG_Labs OptContFac Mariner WBEEShop
  COMSOL elog  Not logged in ELOG logo
Message ID: 38     Entry time: Thu Jun 27 15:06:13 2013
Author: Arnaldo Rodriguez 
Type: Optics 
Category: General 
Subject: PID Function in Manual Simulation 

 I have inserted a rudimentary PID function into the manual simulation code as a way to test whether or not the PID function is changing the defocus values in the desired manner.

I am currently determining the ratio of ring heater power to the steady-state defocus as a way of measuring the scale of the response.

This ought to give a good way of measuring the scale needed to convert the calculated actuator response into an actual load.

I've attached the rudimentary code below. (The actuator isn't feeding into the heater at the moment, but inserting the "actuation" variable into the load expression is all that is required.)

 

Attachment 1: ITMPlusRingPlusPID.m  19 kB  | Show | Hide all | Show all
Attachment 2: PID.m  233 Bytes  | Hide | Hide all | Show all
function [u, e] = PID(s, u, e, Ki, Kp, Kd, deltat, s_target)
   u(2) = u(1);
   e(3) = e(2);
   e(2) = e(1);
   e(1) = s - s_target;
   u(1) = u(2) + Ki*e(1)*deltat + Kp*(e(1) - e(2)) + Kd*(e(1) - 2*e(2) + e(3))/deltat;
end

ELOG V3.1.3-