## 2 Theoretical Design of the PI Controller
If we define the error signal as \(e(t)=y_{sp}-y(t)\) and we replace it in Equation (4) a more general equation is obtained to describe the output of the system as:  
\[y(t)\big{(}1+\eta K_{p}\big{)}=\eta K_{p}y_{sp}\bigg{(}1+\frac{t}{T_{i}}\bigg{)} -\frac{\eta K_{p}}{T_{i}}\int_{0}^{t}y(\tau)d\tau \tag{5}\]  
Considering the _[PERSON]_'s rule for derivation under the integral sign and the parameters \(K_{p}\), \(T_{i}\), \(y_{sp}\) as constants, the derivative Equation (5) with respect to time, results in:  
\[\frac{dy}{dt}\big{(}1+\eta K_{p}\big{)}=\frac{\eta K_{p}}{T_{i}}\big{(}y_{sp}- y(t)\big{)}+\frac{d\eta}{dt}u(t) \tag{6}\]  
The term \(d\eta/dt\) is rewritten using the chain rule and temperature variation, \(dT\), as:  
\[\frac{d\eta}{dt}=\frac{dT}{dt}\frac{d\eta}{dT} \tag{7}\]  
If the temperature is stable \((dT/dt\approx 0)\) and the thermal derivative of the slope efficiency, \(\eta\), is bounded, the term described by Equation (7) approaches zero, and the solution of Equation (6) is:  
\[y(t)=y_{sp}-\big{(}y_{sp}-y_{0}\big{)}e^{-\frac{\eta K_{p}}{(1+\eta K_{p})T_{ i}}t} \tag{8}\]  
The error signal is defined by:  
\[e(t)=\big{(}y_{sp}-y_{0}\big{)}e^{-\frac{\eta K_{p}}{(1+\eta K_{p})T_{i}}t} \tag{9}\]  
The solutions proposed in Equations (8) and (9) are valid under the assumption that both equations are solutions of Equation (5). Therefore, replacing the Equation (9) in Equation (5), we find:  
\[y(t)=f(u(t)) \tag{2}\]0  
The general solution defined in Equation (8) is equated to Equation (10) to obtain the conditions for the solution of simultaneous equations. \[y(t)=f(u(t)) \tag{2}\]1  
\[y(t)=f(u(t)) \tag{2}\]2 Block diagram of PI controller. Finally, in replacing the condition of Equation (11) in Equations (8) and (9) a particular solution is obtained. Thus,  
\[y(t)=f(u(t)) \tag{2}\]3  
\[y(t)=f(u(t)) \tag{2}\]4  
Equations (12) and (13) show that the error signal is asymptotically stable and that the system output converges asymptotically to \(y_{sp}\) if the factor that accompanies the time in the exponential is positive. This factor is known as the characteristic time (\(\tau\)) of the system and is defined as:  
\[y(t)=f(u(t)) \tag{2}\]5  
As seen in Equations (12) and (13), the initial condition, \(y_{0}\), does not directly affect the dynamics of the system. Therefore, the theoretical trajectory of the output is unique and well-characterized. Implying that regardless of the initial conditions of the laser, the response of the system only depends on the control parameters (\(y_{sp}\), \(K_{p}\), and \(T_{i}\)) and the slope efficiency (\(\eta\)). However, the control variable requires knowing the threshold current for the different operating temperatures. To overcome that issue, the control variable is redefined as \((u(t)=I(t))\). Thus, Equation (3) becomes:  
\[y(t)=f(u(t)) \tag{2}\]6  
Replacing the control signal, shown in Equation (4) in Equation (15) we find:  
\[y(t)=f(u(t)) \tag{2}\]7  
Differentiating the Equation (16) with respect to time and considering a stable temperature (\(dT/dt\approx 0\)), the terms \(d\eta/dt\) and \(dI_{th}/dt\) can be approximated to zero if the thermal derivatives of those coefficients (\(d\eta/dT\) and \(dI_{th}/dT\), respectively) are bounded. Thus, the Equation (6) is obtained, and the solutions proposed in Equations (8) and (9) are also valid. Finally, the particular solution for a more general control model is rewritten as  
\[y(t)=f(u(t)) \tag{2}\]8  
\[y(t)=f(u(t)) \tag{2}\]9  
Equations (17) and  
where \(\widehat{K}_{p}=\eta K_{p}\) is the total gain of the system. A numerical solution of Equation (19) can be performed by the Euler method of finite differences, which is equivalent to the iterative model programmed in a real-time controller.