# Laser Power Calibration

These settings are used for analog input control to the laser.&#x20;

#### `laser`

* `laserMinMaxControlVolts` should be the maximum and minimum analog input values that your laser will accept. Set to 5V max for the Obis.&#x20;
* `laserMinMax_mW` is the maximum and minimum power your laser will produce. We will change these in the next section. Leave them alone for now.&#x20;
* `name` is just for information purposes at the moment. Change it to the model name of your laser.
* `maxValueInGUI` is the maximum control value accessible in the GUI. You will be photoactivating in the range of about 1 to 10 mW but you might want more power for the scanner calibration stage. The default maximum power that can be set in the GUI is 30 mW but you can alter it by changing this setting. &#x20;

*Save the settings file and restart Zapit before carrying on*.&#x20;

#### Calibrating the laser

The Zapit GUI allows the user to specify power in mW at the sample. In order to achieve this, the laser must be calibrated using a power meter. A suitable power sensor and meter would be a ThorLabs [S121C](https://www.thorlabs.com/thorproduct.cfm?partnumber=S121C) and [PM100D](https://www.thorlabs.com/thorproduct.cfm?partnumber=PM100D). You can also buy the [PM103A](https://www.thorlabs.com/thorproduct.cfm?partnumber=PM103A) if you want a cheaper unit with the disadvantage that it requires a PC (this unit has an analog output, which you may need so **do not** buy the cheaper [PM100USB](https://www.thorlabs.com/thorproduct.cfm?partnumber=PM100USB)).&#x20;

These instructions are for the Obis laser, the output of which is linear as a function of the control signal. This means it is not necessary to obtain a calibration curve. There is no GUI for laser calibration at present, just follow these steps (Zapit should be running, of course):

* Turn on the laser and wait half an hour for it to warm up and settle.&#x20;
* Place the power sensor where the sample will be and turn on the beam with the "Off/On" control located in the "Laser power (mW)" section of the GUI. <img src="/files/kyP6dLAH2EPV8Z0BhiPX" alt="" data-size="original">
* Set your power meter to the wavelength of your laser and set the scale to the 100s of milliwatts so it does not change range automatically during the process.  Point the beam at the sensor. Make sure you can obtain a reading.&#x20;
* Set the laser to maximum power using the command line. For the Obis this is 5V so we issue at the CLI:\
  `>> hZP.setLaserPowerControlVoltage(5)`
* Read off the value on the power meter. Let's say you read 41.1 mW.&#x20;
* You can now tell Zapit what this maximum value is by entering at the command line: `>> hZP.settings.laser.laserMinMax_mW=[0,41.1];` \
  This updates the YAML settings file so you do not need to edit it.
* Test it by asking for a laser power in mW `>> hZP.setLaserInMW(10)` You will likely find it accurate to within about about 0.1 or 0.2 mW.&#x20;
* If your lower power values in particular are off by more than about 0.2 mW, you can probably improve the things by adding a small offset to the low mW value. e.g. `hZP.settings.laser.laserMinMax_mW(1)=0.04;`\
  Do that by trial and error and things should improve.

Please [file an Issue](https://github.com/Zapit-Optostim/zapit/issues/new/choose) if you have problems with this process or it does not work.<br>

#### Checking power day to day

Put the power meter under the objective and set up as before. Set the power in the GUI or at the command line (e.g. `hZP.setLaserInMW(10)`) and confirm the reading with a power meter. If it is off, repeat the above steps.&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://zapit.gitbook.io/user-guide/installation-and-setup/configuring-zapit/laser-power-calibration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
