C# Class TransferCavityLock2012.Controller

A class for locking the laser using a transfer cavity. The controller reads the voltage fed to the piezo of the cavity, the voltage from a photodiode measuring the light from a master laser (He-Ne) and a further n photodiode signals from n lasers you're trying to lock. The controller then fits a lorenzian to each of these datasets, and works out what to do with each slave laser to keep the peak distances the same. In the hardware class, you need to make a TCLConfig and populate all the fields of that TCLConfig.
Inheritance: System.MarshalByRefObject
显示文件 Open project: ColdMatter/EDMSuite Class Usage Examples

Public Properties

Property Type Description
SlaveLasers SlaveLaser>.Dictionary
TCLState ControllerState
config DAQ.TransferCavityLock2012.TCLConfig
default_ScanPoints int
rampStopLock object
tweakLock object

Public Methods

Method Description
Controller ( ) : System
Controller ( string configName ) : System
DisengageLock ( string name ) : void
EngageLock ( string name ) : void
InitializeLifetimeService ( ) : Object
InitializeUI ( ) : void
RefreshLockParametersOnUI ( string name ) : void
SetLaserSetpoint ( string laserName, double newSetpoint ) : void
Start ( ) : void
StartLogger ( ) : void
StartTCL ( ) : void
StopLogger ( ) : void
StopTCL ( ) : void

This will make the program exit the while loop in ramploop. Note: this will call

UpdateUIState ( string name, SlaveLaser state ) : void

The controller needs to be able to change the UI. Enabling buttons, changing the values in text boxes...

disposeMasterVoltageOut ( ) : void
setupMasterVoltageOut ( ) : void
writeMasterVoltageOut ( double voltage ) : void

Private Methods

Method Description
AddSetPointDecrement ( string name ) : void
AddSetPointIncrement ( string name ) : void
GainChanged ( string name, double g ) : void
RefreshErrorGraph ( string name ) : void
SetPointIncrementSize ( string name, double value ) : void
VoltageToLaserChanged ( string name, double voltage ) : void

These are events triggered by one of the LockControlPanels. Example: User changes the voltage to be sent to the slave laser. The UI will call VoltageToLaserChanged. Each LockControlPanel knows which laser it corresponds to. so the "name" argument tells the controller which SlaveLaser class it needs to send the command to!

acquireAI ( ScanParameters sp ) : CavityScanData

Reads some analogue inputs. The basic unit of the program.

calculateNewMasterVoltage ( double masterV ) : double
checkRampChannel ( ) : bool

Functions for locking master laser to cavity length

createInitialScanParameters ( ) : ScanParameters
endRamping ( ) : void

The function which gets called at the end, after breaking out of the while loop.

fitMaster ( CavityScanData data ) : double[]
fitSlave ( string name, CavityScanData data ) : double[]
getErrorCount ( string name ) : int
incrementCounter ( string name ) : void
initializeAIHardware ( ScanParameters sp ) : void

Prepares the hardware for analog reads.

initializeAIs ( string>.Dictionary channels ) : void
initializeSlaveLaserControl ( string>.Dictionary lockableLasers ) : void
mainLoop ( ) : void

The main loop. Reads the analog inputs, fits to the data and (when locked) adjusts the slave laser voltage.

plotCavity ( CavityScanData data ) : void
plotError ( string name, double time, double error ) : void
plotMaster ( CavityScanData data ) : void
plotMaster ( CavityScanData data, double MasterFit ) : void
plotSlave ( string name, CavityScanData data, double slaveFit ) : void
plotSlaveNoFit ( string name, CavityScanData data ) : void
readParametersFromUI ( ) : void
updateTime ( System.DateTime previousTime ) : void

Method Details

Controller() public method

public Controller ( ) : System
return System

Controller() public method

public Controller ( string configName ) : System
configName string
return System

DisengageLock() public method

public DisengageLock ( string name ) : void
name string
return void

EngageLock() public method

public EngageLock ( string name ) : void
name string
return void

InitializeLifetimeService() public method

public InitializeLifetimeService ( ) : Object
return Object

InitializeUI() public method

public InitializeUI ( ) : void
return void

RefreshLockParametersOnUI() public method

public RefreshLockParametersOnUI ( string name ) : void
name string
return void

SetLaserSetpoint() public method

public SetLaserSetpoint ( string laserName, double newSetpoint ) : void
laserName string
newSetpoint double
return void

Start() public method

public Start ( ) : void
return void

StartLogger() public method

public StartLogger ( ) : void
return void

StartTCL() public method

public StartTCL ( ) : void
return void

StopLogger() public method

public StopLogger ( ) : void
return void

StopTCL() public method

This will make the program exit the while loop in ramploop. Note: this will call
public StopTCL ( ) : void
return void

UpdateUIState() public method

The controller needs to be able to change the UI. Enabling buttons, changing the values in text boxes...
public UpdateUIState ( string name, SlaveLaser state ) : void
name string
state SlaveLaser
return void

disposeMasterVoltageOut() public method

public disposeMasterVoltageOut ( ) : void
return void

setupMasterVoltageOut() public method

public setupMasterVoltageOut ( ) : void
return void

writeMasterVoltageOut() public method

public writeMasterVoltageOut ( double voltage ) : void
voltage double
return void

Property Details

SlaveLasers public_oe property

public Dictionary SlaveLasers
return SlaveLaser>.Dictionary

TCLState public_oe property

public ControllerState TCLState
return ControllerState

config public_oe property

public TCLConfig,DAQ.TransferCavityLock2012 config
return DAQ.TransferCavityLock2012.TCLConfig

default_ScanPoints public_oe property

public int default_ScanPoints
return int

rampStopLock public_oe property

public object rampStopLock
return object

tweakLock public_oe property

public object tweakLock
return object