diff options
author | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2022-01-02 21:12:23 -0500 |
---|---|---|
committer | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2022-01-02 21:12:23 -0500 |
commit | 7e8bf3dc9f0162ac1e30d6e57315937ff70506d5 (patch) | |
tree | c561b11db26f896fa92a4b8082f5dc8fc0d85ce9 /examples | |
parent | e833f38065eaa23a0bd6a050195d77d2b9a8b575 (diff) | |
download | pyExpControl-7e8bf3dc9f0162ac1e30d6e57315937ff70506d5.tar.gz pyExpControl-7e8bf3dc9f0162ac1e30d6e57315937ff70506d5.zip |
added measurements of magnetic control voltage response
Diffstat (limited to 'examples')
-rw-r--r-- | examples/lock_eit.py | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/examples/lock_eit.py b/examples/lock_eit.py index 8742db3..08522c5 100644 --- a/examples/lock_eit.py +++ b/examples/lock_eit.py @@ -233,6 +233,64 @@ async def main(): lockin_slope= await calibratingLockin() + async def responseToChangeOfBfieldControlVoltage(): + apparatus.state = f'Calibrating lockin response to change of Bfield control voltage, {rfPout} dBm' + logger.info(apparatus.state) + update_webpage(apparatus=apparatus) + ai['pid'].setEnable(True) + ai['pid'].reset() + apparatus.gui_log.setTraces( initLog() ) + dV = 0.01 + ai['lockin'].AuxOut1=dV + apparatus.getBCurrent(); # this automatically logs value to TSDB + + # initial lock + ai['pid'].setEnable(True) + ai['pid'].reset() + res = await asyncio.gather( + feedbackLoop(apparatus, nsteps=20) + ) + + # this is for the money lock + res = await asyncio.gather( + feedbackLoop(apparatus, nsteps=30) + ) + + fr0 = ai['rfgen'].getFreqFixed() + apparatus.getBCurrent(); # this automatically logs value to TSDB + + # this is for the money lock + ai['lockin'].AuxOut1=0 + ai['pid'].setEnable(True) + ai['pid'].reset() + res = await asyncio.gather( + feedbackLoop(apparatus, nsteps=30) + ) + fr1 = ai['rfgen'].getFreqFixed() + + log = apparatus.gui_log.traces + trE=log.getTrace('error') + + df = fr0 - fr1 + slope = df/dV + + logger.info(f'df = {df}') + logger.info(f'response to magnetic control voltage = {slope} Hz/V') + + apparatus.getBCurrent(); # this automatically logs value to TSDB + + # relock to default state + ai['lockin'].AuxOut1=0 + ai['pid'].setEnable(True) + ai['pid'].reset() + res = await asyncio.gather( + feedbackLoop(apparatus, nsteps=20) + ) + + return slope + + B_response= await responseToChangeOfBfieldControlVoltage() + logger.info('========= Long term lock ===========') apparatus.gui_log.setTraces( initLog() ) apparatus.gui_log.traces.config['tags']['lockin_slope']=float(lockin_slope) |