## 2 Circuit Design  
A module of the bidirectional current source consists of several parts forming a loop (Figure 1). The source part pushes the current through external coils and a high-power current sense resistor \(R_{\text{sense}}\). A process variable--current--is measured on the sense resistor in the current measurement section and is sent to the last stage, the PID controller. In the PID part, the value of the measured current is compared with an analog set point, and a control signal is calculated. It is then sent to the source part closing the feedback loop. There are several common circuits for bipolar current sources, such as Howland pumps, current-in/current-out amplifiers, and push-pull setups (based on transistors or operational amplifiers) [11; 12; 13; 14; 15]. We choose the latter solution to obtain high-output currents and smooth, linear zero-current crossing. The other listed designs cannot easily fulfill both requirements. The current source part is a modified version of a design originally developed by [PERSON] and [PERSON] [23]. The core of the circuit is a pair of high-power amplifiers (OPA549, Texas Instruments), which are capable of sourcing up to 8 A continuously. They are connected in a push-pull configuration with the 2 A/V gain. The current flows between the outputs of the amplifiers, through a sense resistor and external coils. To enhance the timing characteristic of the current source, especially when it is loaded with an inductive coil, we added lead compensation. It may be adjusted for a particular load impedance by changing the capacitor and resistor values. The lead compensation lowers both the rise time and the maximum overshoot by adding an additional pole in the transfer function on the high frequency side. The elements of the lead compensator need to be placed symmetrically in feedback loops for both amplifiers inputs. An optional lag compensation enhances steady-state stability. To a large extent, it is already provided by the PID control section, but it is useful in noisy environments, since it directly low passes the inputs of the current source section. The lead and lag compensators set the primary bandwidth limitations of the whole circuit, since the PID parameters are adjusted to the performance of the current source section. However, the transfer function of the system may be modified to enhance the circuit's bandwidth by changing the values of the resistors and capacitors used in both compensators. The output current is proportional to the input voltage, \(U_{\text{control}}\), referenced to the second input, which is shorted to the ground. This makes the circuit's response symmetric around 0 V, and, as such, it provides an intuitive relation between the direction and the amplitude of the current. The control signal may be also referenced if controlled with a digital device with a different operation voltage. Figure 1: The source section of the push–pull operational amplifier bipolar current source. The main operational amplifiers (OPA549) work interchangeably as a current source and a sink allowing for bidirectional current flow through external coils. The current value is sensed on the \(R_{\text{sense}}\) resistor, placed in series with \(L_{\text{load}}\). The output current is proportional to the input \(U_{\text{control}}\) voltage referenced to the second input (here, grounded). For the full formula, see Equation (1). (**a**) Parts of the lead compensator for response timing enhancement. (**b**) Parts of the optional lag compensator for enhancing the steady state performance. (**c**) The high power, temperature-stable sense resistor for current measurement. (**d**) External coils with total inductance \(L_{\text{load}}=2.9\,\text{mH}\) and total resistance \(R_{\text{load}}=2.1\,\Omega\).