## 5 Design and Implementation of the Isolated Voltage Sensors  
As mentioned in Section 1, one of the disadvantages of the digitally controlled PFC converter is that the voltage and current sensors that are required for interfacing with the MCU are expensive. In this section, for the economic and reliable operation of the designed digitally controlled PFC converter, two voltage sensors with low price components for sensing the AC input and the DC output voltage of the PFC converter are designed to interface with DSP TMS320F28335 (Texas Instruments, Dallas, TX, USA). Figure 19 shows the schematic circuit of the proposed isolated DC voltage sensor. For DSP TMS320F28335 [31], the input voltage range of the analog digital converter (ADC) is 0 to 3 V DC voltage. So, the voltage sensors should be designed to convert the measured DC output voltage of the PFC converter to the available input range of the ADC of the DSP MCU. The voltage sensor consists of two stages. The first stage is implemented using the voltage dividers R\({}_{1}\) and R\({}_{2}\) and the isolation amplifier (IC\({}_{1}\)) to offer isolation between the high-voltage power circuit and the low-voltage control circuit. The second stage is the operational amplifier (IC\({}_{2}\)) circuit, which is used to adjust the sensor voltage to the required value based on its operation mode. From the gain of the chosen isolation amplifier (IC\({}_{1}\)) in the first stage, the values of resistors R\({}_{1}\) and R\({}_{2}\) can be designed as  
\[\mathrm{V_{bus\_Max}}=\mathrm{V_{p\_Max}}\cdot\frac{\mathrm{R_{2}}}{\mathrm{ R_{1}+R_{2}}}. \tag{46}\]  
where \(\mathrm{V_{p\_Max}}\) is the maximum primary voltage of the isolation amplifier and can be easily known from the datasheet of the chosen isolation amplifier (IC1). Then, by choosing the value of R\({}_{1}\), the value of R\({}_{2}\) can be calculated from Equation (46). An AMC1311 isolation amplifier from Texas instruments (TI) with a primary voltage range of about 2 V and unity voltage gain was used in the designed sensor, which provides galvanic isolation up to 7 kV,  
Figure 19: Block diagram of the designed isolated DC voltage sensor (V.S 2). Figure 18: Step response of the inner current control loop with different controllers. low offset error, very low nonlinearity of less than 0.03%, and is inexpensive (about USD 3), which provides a highly reliable and economic design of isolated voltage sensing [32]. The inverting analog output from the AMC1311 IC is a fully differential signal and should provide bias voltage to the operational amplifier (IC2). The operational amplifier should be chosen to offer wide bandwidth and low slew rate time and low noise. The OPA320 operational amplifier from TI was used in this study, having a wide bandwidth of more than 20 MHz, a low slew rate time to the output voltage of about 10 V/ us, and costing only about USD 2.50 [33]. The expected total price of the proposed sensor is less than USD 10, which is very inexpensive compared with the other sensor types such as LV25-P sensor, which costs about USD 80, which was used for voltage sensing in a previous study [8]. The operational amplifier implemented in the proposed sensor works in inverting mode, so the close- loop voltage gain (\(\beta\)) can be expressed as  
\[\beta=\left|\frac{\mathrm{V_{o\_Fb}}}{\mathrm{V_{s\_Max}}}\right|=\frac{ \mathrm{R_{4}}}{\mathrm{R_{3}}}. \tag{47}\]  
where \(\mathrm{V_{s\_Max}}\) is the maximum secondary voltage of the isolation amplifier and can be calculated using  
\[\mathrm{V_{s\_Max}}=\mathrm{V_{p\_Max}}\cdot\alpha. \tag{48}\]  
where \(\alpha\) is the isolation amplifier voltage gain. Choosing the \(\mathrm{R_{3}}\) value, the value of the resistance \(\mathrm{R_{4}}\) can be easily calculated using Equation (47). Figure 20 shows the input output voltage curves for the designed isolated voltage sensor, demonstrating that for the input voltage of 400 V DC, the output voltage level is limited from 0 to 3 V with a very small slew rate time of about 25 us.