Advanced Control of a Compensator Motor Driving a Variable Speed Diesel Generator with Rotating Stator

: Variable speed generators can improve overall genset performance by allowing the diesel engine to reduce its speed at lower loads. In this project, a variable speed diesel generator (VSDG) uses a rotating stator driven by a compensator motor. At lower loads, the stator turns in the opposite direction of the rotor, a process that can be used for purposes like maintaining a ﬁxed relative speed between the two components of a generator. This allows the diesel engine to turn at a lower speed (same as the rotor) and to increase its e ﬃ ciency. The present research addresses the control of the compensator motor driving the generator’s stator using a variable-frequency drive that adapts the speed to its optimal value according to the load. The performance of the proposed control strategy was tested using a Freescale microcontroller card programmed in C-code to determine the appropriate voltage for the variable-frequency drive. The control algorithm uses a real-time application implemented on an FDRM-KL25Z signal processor board. The control performance of a 2 kW asynchronous motor (LabVolt EMS 8503-00 / 208 V / 3 ϕ / 60(50) Hz) was demonstrated experimentally at di ﬀ erent operating conditions.


Introduction
Nowadays, several electric production applications such as hybrid standalone or grid-connected applications are still using diesel generators (DGs). Despite the huge growth of renewable energy contributions in electric production, DG performance optimization is critical due to its important role in electric energy production. This research focuses on the optimization of a variable speed diesel generator (VSDG) based on a new rotating stator technology for an electric generator. The stator rotation and synchronization with the rotor is controlled by a compensator variable speed AC motor. This section addresses the state-of-the-art of existing technologies related to the project.

Variable Speed Diesel Generator
Conventional diesel generators (DGs) generally operate at fixed speeds, 1800 or 1500 rpm, to produce 60 or 50 Hz of current, respectively. During operation, the electric load varies and affects the operation regime of the DG; for lower loads, while maintaining the fixed rotational speed, genset efficiency drops, and specific fuel consumption (the fuel quantity required to produce a given amount of energy) and greenhouse gas (GHG) emissions increase [1]. The reason is that at lower loads, the

Variable Speed AC Motor
More than 60% of electric load consumption belongs to AC motors in industrial and residential sectors [9]. Several control methods are available to adjust AC motor speed to meet different application conditions [9]. Vector control is an integrated control method for AC motor speed based on a dynamic model. Vector control integrates torque, magnetic flux, and rotor position elements. The implementation of these space vector methods, which requires precise and fast mathematical calculations, increased significantly with the development of more powerful microcontrollers in the past few decades, as detailed in [10,11]. Vector control techniques are complex and expensive, but they can accurately control the speed of motors in large intervals from zero to more than the rated speed. Generally, proportional integral and derivative (PID) regulators in inner and outer control loops simultaneously achieve a variable voltage and variable frequency regulation [12]. This strategy improves motor response time and decreases unreliable performance. The flux production of armature and stator magnetic field are of main interest. The magnitude of the rotating magnetic field is proportional to the Energies 2020, 13, 2224 3 of 15 fluctuation of both voltage and frequency. Therefore, the value of the rotating magnetic field keeps constant if the change of both voltage and frequency magnitude keep constant. As such, machine speed varies its speed without any disturbance [13,14]. For instance, in [15], a closed-loop space vector control method employed a hysteresis, current controlled, voltage source inverter. The author proposed an integral plus proportional controller, based on a sinusoidal pulse-width modulation (SPWM) inverter, as an effective method to achieve a fast dynamic response and linear performance of the AC motor. Another important parameter in motor speed control is magnetic torque. Commonly, the treatment of the motor-phase current is an effective way to proportionally change motor speed and electric torque [16]. Finally, significant improvements to control the speed of AC motors are using vector control methods [17]. Power converters facilitate control within a wide range of speeds and induction torques, specific to different applications. Industrial automation can rely on electric drives (EDs), leading to a higher productivity and better efficiency. However, the fast growth and wide variety of EDs in industrial applications may impair power quality and induce harmonic pollution into the power system.

Variable Speed Diesel Generator (VSDG) with Rotating Stator
In this research, we adjusted the diesel engine speed to the load using a new generator concept based on a rotating stator. Unlike in other generators, here, the stator rotation is driven by a "compensator" AC motor in such a way to maintain a fixed relative speed between the stator and the rotor [18]. Therefore, the generator speed is no longer limited to the rotor speed. Subsequently, synchronous speed is achieved using rotor speed, stator speed, or a combination of both. Rotating-stator technology reduces the need for power electronics to maintain a constant voltage and frequency. As such, the generator maintains its synchronous speed using stator rotation, while the diesel engine can adapt its speed to operate at the maximum efficiency dictated by the operation conditions [19]. Based on the explanation above, the synchronous generator (SG) speed is the sum or difference between rotor and stator speed, respectively, if they turn in opposite or same direction: n synch (Total) = n Rotor ± n Stator Consequently, at lower loads, the diesel engine slows down to avoid unnecessary torque production, and, simultaneously, the stator turns at the required speed to meet power quality standards. Figure 1 illustrates the general operation of the proposed VSDG using a controlled compensator motor to drive the stator. The compensator motor automatically starts once the grid consumption drops under a threshold value. Based on the real-time load variation, a speed control algorithm was developed for the induction motor (compensator motor). The compensator motor (CM) is connected to the stator of the synchronous generator (SG) using a small gearbox and is powered by the SG itself. The rotating stator technology improves the performance and efficiency of VSDG applications and reduces the role of power converters. The variable-speed operation reduces fuel consumption when the system operates under a low electric load regime [20]. No power converter is used on the SG's end, as the variable speed is achieved by controlling the stator speed. This technology reduces the risk of power capacitor shortage in the power converter and improves system flexibility because the DE speed is no longer limited by the power converter capacity. However, adding a compensator motor increases the mechanical complexity and maintenance process of the machine [21].
The main objective of this research was to improve the efficiency of the VSDG at low load regime. For instance, if, at a given load, the optimal efficiency of the diesel engine is at 1500 rpm, it means that the generator rotor should also turn at 1500 rpm. Consequently, the CM turns the stator at 300 rpm in the opposite direction of the rotor. Synchronous generator speed reaches 1800 rpm while the diesel engine speed stays at 1500 rpm, as required by its optimal operation. fuel consumption when the system operates under a low electric load regime [20]. No power converter is used on the SG's end, as the variable speed is achieved by controlling the stator speed. This technology reduces the risk of power capacitor shortage in the power converter and improves system flexibility because the DE speed is no longer limited by the power converter capacity. However, adding a compensator motor increases the mechanical complexity and maintenance process of the machine [21].   Figure 2 illustrates the architecture of the VSDG with a rotating stator and compensator motor. This new technology increases the overall performance of the VSDG by allowing the DE to operate at maximum efficiency speed. In a conventional genset, the engine and generator speed are fixed. Moreover, an SG needs to rotate at its synchronous speed to produce the required power quality when it operates at either a low or full load. The engine shaft coupled with the generator's rotor rotates at the SG's nominal speed at all regimes. Therefore, an oscillation of the DE speed affects power quality. Load oscillation is another factor that reduces system efficiency in fixed gensets. These phenomena affect power quality and increase DE fuel consumption. In addition, the DE is not able to follow these oscillations, and its poor performance is not independent of the fuel governor device [22].

Architecture of the VSDG with Rotating Stator
This VSDG technology uses several rows of bearings installed between the outer frame of the stator and the generator in order to allow for the independent rotation of the stator. These bearings have minimum friction with the generator housing. The stator frame and the rotor shaft are also mounted in the generator housing on both sides with the use of robust bearings. This modification allows for both parts of the generator, the rotor and stator, to rotate around the same axis. It is important to mention that the stator windings, core, and connections remain the same as those of a conventional generator [23]. The main objective of this research was to improve the efficiency of the VSDG at low load regime. For instance, if, at a given load, the optimal efficiency of the diesel engine is at 1500 rpm, it means that the generator rotor should also turn at 1500 rpm. Consequently, the CM turns the stator at 300 rpm in the opposite direction of the rotor. Synchronous generator speed reaches 1800 rpm while the diesel engine speed stays at 1500 rpm, as required by its optimal operation. Figure 2 illustrates the architecture of the VSDG with a rotating stator and compensator motor. This new technology increases the overall performance of the VSDG by allowing the DE to operate at maximum efficiency speed. In a conventional genset, the engine and generator speed are fixed. Moreover, an SG needs to rotate at its synchronous speed to produce the required power quality when it operates at either a low or full load. The engine shaft coupled with the generator's rotor rotates at the SG's nominal speed at all regimes. Therefore, an oscillation of the DE speed affects power quality. Load oscillation is another factor that reduces system efficiency in fixed gensets. These phenomena affect power quality and increase DE fuel consumption. In addition, the DE is not able to follow these oscillations, and its poor performance is not independent of the fuel governor device [22].

Architecture of the VSDG with Rotating Stator
This VSDG technology uses several rows of bearings installed between the outer frame of the stator and the generator in order to allow for the independent rotation of the stator. These bearings have minimum friction with the generator housing. The stator frame and the rotor shaft are also mounted in the generator housing on both sides with the use of robust bearings. This modification allows for both parts of the generator, the rotor and stator, to rotate around the same axis. It is important to mention that the stator windings, core, and connections remain the same as those of a conventional generator [23]. A pulley is coupled to the stator frame and mounted on the generator casing. By applying mechanical force on the pulley itself, the stator starts to rotate at the desired speed and direction. A small-size compensator motor is fixed above the generator casing and is connected to the stator pulley with a timing belt. A small mechanical gearbox is installed on the SG's housing and fixed on the CM shaft. The reason for having this gearbox is to easily connect the CM shaft with the timing belt and to adjust the stator speed to the desired value. In the patent describing the technology, the speed of CM A pulley is coupled to the stator frame and mounted on the generator casing. By applying mechanical force on the pulley itself, the stator starts to rotate at the desired speed and direction. A small-size compensator motor is fixed above the generator casing and is connected to the stator pulley with a timing belt. A small mechanical gearbox is installed on the SG's housing and fixed on the CM shaft. The reason for having this gearbox is to easily connect the CM shaft with the timing belt and to adjust the stator speed to the desired value. In the patent describing the technology, the speed of CM shaft is converted to 250 rpm using the mechanical gearbox. However, depending on the optimum speed efficiency of the DE, the mechanical gearbox may be adjusted [24]. CM electricity is supplied by the genset itself and is able to run at either 50 or 60 Hz. During low load, the DE speed decreases to save fuel, and the CM begins to rotate the stator at the appropriate speed and direction to keep the generator at synchronous speed. For instance, if engine speed falls to 1500 rpm for efficiency purposes, the CM adjusts stator speed at 300 rpm in the opposite direction of the rotor. The result is that the generator keeps its speed at 1800 rpm to support electric demand, whereas the DE speed adjusts at its most efficient point.
The aim of this project was to control the CM speed with a reliable and robust method to achieve an efficient diesel-generator operation. This technology alleviates system complexity by eliminating power converters from generators' rotors and stators [20]. A much smaller-scale electronic controller ensures CM control and operation. This results in better fuel consumption profile, a robust speed controller method, and a vast range of variable speeds without limitation by converter capacity [22].

Sensor-Less Space Vector Modulation (SVM) Speed Controller Based on Constant V/F
Frequency drives offer many advantages such as low harmonic distortion, bidirectional power flow, and fast dynamic response [25]. In this work, we connected a programmed microcontroller with a power drive using the direct power control and space vector modulation (DPC-SVM) method. Figure 3 shows the configuration of the voltage source converter (VSC) based on a constant switching frequency operation. To eliminate high-switching frequency, we introduced a passive resistor/capacitor (RC) filter [26,27]. However, in this structure, three-phase power is used as variable feedback for the PWM controller to mitigate low order harmonics in case of unbalanced loads.
Energies 2020, 13, x FOR PEER REVIEW 5 of 15 speed efficiency of the DE, the mechanical gearbox may be adjusted [24]. CM electricity is supplied by the genset itself and is able to run at either 50 or 60 Hz. During low load, the DE speed decreases to save fuel, and the CM begins to rotate the stator at the appropriate speed and direction to keep the generator at synchronous speed. For instance, if engine speed falls to 1500 rpm for efficiency purposes, the CM adjusts stator speed at 300 rpm in the opposite direction of the rotor. The result is that the generator keeps its speed at 1800 rpm to support electric demand, whereas the DE speed adjusts at its most efficient point. The aim of this project was to control the CM speed with a reliable and robust method to achieve an efficient diesel-generator operation. This technology alleviates system complexity by eliminating power converters from generators' rotors and stators [20]. A much smaller-scale electronic controller ensures CM control and operation. This results in better fuel consumption profile, a robust speed controller method, and a vast range of variable speeds without limitation by converter capacity [22].

Sensor-Less Space Vector Modulation (SVM) Speed Controller Based on Constant V/F
Frequency drives offer many advantages such as low harmonic distortion, bidirectional power flow, and fast dynamic response [25]. In this work, we connected a programmed microcontroller with a power drive using the direct power control and space vector modulation (DPC-SVM) method. Figure 3 shows the configuration of the voltage source converter (VSC) based on a constant switching frequency operation. To eliminate high-switching frequency, we introduced a passive resistor/capacitor (RC) filter [26,27]. However, in this structure, three-phase power is used as variable feedback for the PWM controller to mitigate low order harmonics in case of unbalanced loads. In this configuration, L is an inductor to repel the current oscillations, the opto-isolators are the filters to regulate the input signals, and the drives are transistors to precisely trigger the IGBTs. The DPC method makes it possible to send appropriate signals by estimating the instantaneous position of the rotor. AC motors need the precise AC voltage signals to have the oscillations that are proportional to the frequency. For this reason, variable frequency drives (VFDs) are always arranged in a way to regulate output Voltage/Frequency to a constant ratio and value. VFDs create variable voltage and frequency to change AC motor speed. Accordingly, the speed of the AC motor varies with the change in frequency, and the higher the frequency applied to the motor, the faster the motor rotates [28]. The control principle of the VSC uses the SVM-PWM method by separating the voltage and current components. One of the reasons for connecting the feedback control loop in the SVM In this configuration, L is an inductor to repel the current oscillations, the opto-isolators are the filters to regulate the input signals, and the drives are transistors to precisely trigger the IGBTs. The DPC method makes it possible to send appropriate signals by estimating the instantaneous position of the rotor. AC motors need the precise AC voltage signals to have the oscillations that are proportional to the frequency. For this reason, variable frequency drives (VFDs) are always arranged in a way to Energies 2020, 13, 2224 6 of 15 regulate output Voltage/Frequency to a constant ratio and value. VFDs create variable voltage and frequency to change AC motor speed. Accordingly, the speed of the AC motor varies with the change in frequency, and the higher the frequency applied to the motor, the faster the motor rotates [28]. The control principle of the VSC uses the SVM-PWM method by separating the voltage and current components. One of the reasons for connecting the feedback control loop in the SVM method is to adjust the instantaneous active power (P) toward its reference value. The second reason is to follow and evaluate the reactive power (Q) to directly regulate the DC-Link. The unit power factor can also be acquired by monitoring the reactive power. In this method, both P and Q are calculated in α and β reference frames using Clark's transformation as follows: where E α , E β , i α , and i β represent components on α and β axes for the output voltage and current, respectively. DPC-SVM estimates the reference stator voltage to minimize the torque and current ripples. Based on SVM modulates, PWM creates appropriate signals to generate reliable sinusoidal waveforms using constant switching frequency. v s (ideal motor speed) is a produced voltage signal coming from a microcontroller card. The power converter receives a treated voltage signal v s , which is 0-10 V and creates the requested frequency at the output point to control the motor speed. In conclusion, for this part, the VFD using the DPC method receives treated v s as input from the microcontroller and produces constant torque and variable speed using a constant ratio V/F strategy.

AC Motor Speed Control with Microcontrollers
Microcontrollers are programmable, reusable, and cost-effective devices that create sine pulse width modulation signals for switching purposes [29]. In this research, we used a Freescale FRDM-KL25Z microcontroller card programmed with the MCUXpresso software. After compiling the required code, the FreeMASTER software was used as a run-time developer application to monitor the real-time experiment. The aim of this section was to propose a simple control algorithm to achieve ideal speeds for an induction motor coupled with the stator of a VSDG. There were several objectives associated with this approach: 1. High reliability achieved by a self-correction loop.
Fast processing speed and high accuracy. 4.
High efficiency due to accurate switching command. Figure 4 shows a complete diagram of a simple and robust application for controlling motor speed based on the load fluctuation. Several parameters must be set on the digital signal processor (DSP) controllers to create a sine wave simulator. The default mode of this controller is only able to process 12-bit DC signals and send the requested response to its output ports. In this application, we needed a controlled 0-10 V AC voltage at the output port of the DSP card to trigger the VFD system. To start encoding the analog-to-digital conversion board (ADC), we needed to initialize some parameters including the signal processing time and the number of samples per cycle. The FreeMASTER software could recognize the internal and external ports of the DSP for its control algorithm. However, the input and output port voltages were 0-3 and 0-5 V, respectively. This board is capable of receiving DC current and voltage signals from its input and sending the appropriate voltage signal to the AC power converter. Therefore, additional devices were required to adapt the microcontroller card to the power converter and the measuring devices (sensors). Figure 5 illustrates the complete bit space definition and its domain based on DSP card limits. The input values were converted into DC signals and inserted in the control algorithm based on specific current and voltage limits. Near to 250 sample signals were embedded each 1 ms to create high-quality sinusoidal waveform and reduce graph discretization. Our objective was to regulate the AC motor Energies 2020, 13, 2224 7 of 15 speed based on the load oscillation. Therefore, both feedbacks illustrated in Figure 4 came from the current and voltage measurement devices. They were able to track the load variation and send an appropriate signal to the DSP input ports.  Figure 5 illustrates the complete bit space definition and its domain based on DSP card limits. The input values were converted into DC signals and inserted in the control algorithm based on specific current and voltage limits. Near to 250 sample signals were embedded each 1 ms to create high-quality sinusoidal waveform and reduce graph discretization. Our objective was to regulate the AC motor speed based on the load oscillation. Therefore, both feedbacks illustrated in Figure 4 came from the current and voltage measurement devices. They were able to track the load variation and send an appropriate signal to the DSP input ports.

Design of the Speed Control Algorithm and Numerical Simulation
The objective of this section was to develop the control algorithm for the AC motor used as a compensator for the rotating stator VSDG. The AC motor drives the stator of a VSDG, such as the diesel engine, and the rotor reduces their speed to avoid producing unnecessary energy during low electric demand.
Unlike numerous studies focusing on the generator's electric output treatment with a power converter, we varied the speed of the DG using a new technology based on a rotating stator. Thus, the AC motor shaft was coupled to the rotating stator and compensated for the required speed of the electric generator to avoid harmonic distortion when the diesel engine slowed down. As a result, the control algorithm was able to regulate the speed of the compensator motor by tracking the electric load variation. Different loops and conditions in this algorithm ensure that motor performance is   Figure 5 illustrates the complete bit space definition and its domain based on DSP card limits. The input values were converted into DC signals and inserted in the control algorithm based on specific current and voltage limits. Near to 250 sample signals were embedded each 1 ms to create high-quality sinusoidal waveform and reduce graph discretization. Our objective was to regulate the AC motor speed based on the load oscillation. Therefore, both feedbacks illustrated in Figure 4 came from the current and voltage measurement devices. They were able to track the load variation and send an appropriate signal to the DSP input ports.

Design of the Speed Control Algorithm and Numerical Simulation
The objective of this section was to develop the control algorithm for the AC motor used as a compensator for the rotating stator VSDG. The AC motor drives the stator of a VSDG, such as the diesel engine, and the rotor reduces their speed to avoid producing unnecessary energy during low electric demand.
Unlike numerous studies focusing on the generator's electric output treatment with a power converter, we varied the speed of the DG using a new technology based on a rotating stator. Thus, the AC motor shaft was coupled to the rotating stator and compensated for the required speed of the electric generator to avoid harmonic distortion when the diesel engine slowed down. As a result, the control algorithm was able to regulate the speed of the compensator motor by tracking the electric load variation. Different loops and conditions in this algorithm ensure that motor performance is always within the intended area. The microcontroller receives voltage and current signals to calculate

Design of the Speed Control Algorithm and Numerical Simulation
The objective of this section was to develop the control algorithm for the AC motor used as a compensator for the rotating stator VSDG. The AC motor drives the stator of a VSDG, such as the diesel engine, and the rotor reduces their speed to avoid producing unnecessary energy during low electric demand.
Unlike numerous studies focusing on the generator's electric output treatment with a power converter, we varied the speed of the DG using a new technology based on a rotating stator. Thus, the AC motor shaft was coupled to the rotating stator and compensated for the required speed of the electric generator to avoid harmonic distortion when the diesel engine slowed down. As a result, the control algorithm was able to regulate the speed of the compensator motor by tracking the electric load variation. Different loops and conditions in this algorithm ensure that motor performance is always within the intended area. The microcontroller receives voltage and current signals to calculate the instantaneous active power every one millisecond following the control algorithm structure. The algorithm structure adds every voltage and current value based on the time domain to produce an Energies 2020, 13, 2224 8 of 15 appropriate voltage signal. The microcontroller sends voltage signal to the VFD to control the CM speed. Figure 6 shows the structure of the control algorithm based on load power calculation. The three most important steps to define the control algorithm are as follows: 1. Workspace Generation. The first step to program every microcontroller is to provide an ideal environment with accurate classifications and specifications. The workspace may consist of several source code files that create a large environment. For this application, voltage and current sensors and a host computer were the external peripheral devices to be recognized by the software workspace and DSP ports. Workspace unfolds input signals every time the control algorithm requires them. Moreover, appropriate DSP ports found on the electric card's data sheet should be well-recognized by the software parameters.
2. Speed Control Implementation. Two main inputs were embedded in the controller coming from voltage and current measurement devices. These components were transformed into voltage signals, using limiters, before being processed by the algorithm. Both voltage and current parameters measured from the demand side are used in the equation below to determine the load power. The principle of the control algorithm is based on the instantaneous power formula. Accordingly, the control program runs by sending commands from the host computer to the microcontroller card. The control algorithm processes the input signals and produces appropriate signals for the power converter based on instantaneous electric grid consumption. One advantage of such a controller is the fast motor response and high electric torque production.

Instantaneous Power = (Value [0] × Value [1]) Number o f samples
Real electric load varies asymptotically, and it consists of the active and reactive parts. Apparent power represents the total electric power value considering the angle between voltage and current. As this project aimed to synchronize the DE production with demanded mechanical torque applied on the DE shaft, for the mathematical calculations, only the active power was considered; the apparent power was not calculated. In addition, the instantaneous calculation of active power reduced the complexity of the control algorithm and resulted in a fast microcontroller response.
Energies 2020, 13, x FOR PEER REVIEW 8 of 15 the instantaneous active power every one millisecond following the control algorithm structure. The algorithm structure adds every voltage and current value based on the time domain to produce an appropriate voltage signal. The microcontroller sends voltage signal to the VFD to control the CM speed. Figure 6 shows the structure of the control algorithm based on load power calculation. The three most important steps to define the control algorithm are as follows: 1. Workspace Generation. The first step to program every microcontroller is to provide an ideal environment with accurate classifications and specifications. The workspace may consist of several source code files that create a large environment. For this application, voltage and current sensors and a host computer were the external peripheral devices to be recognized by the software workspace and DSP ports. Workspace unfolds input signals every time the control algorithm requires them. Moreover, appropriate DSP ports found on the electric card's data sheet should be well-recognized by the software parameters.

2.
Speed Control Implementation. Two main inputs were embedded in the controller coming from voltage and current measurement devices. These components were transformed into voltage signals, using limiters, before being processed by the algorithm. Both voltage and current parameters measured from the demand side are used in the equation below to determine the load power. The principle of the control algorithm is based on the instantaneous power formula. Accordingly, the control program runs by sending commands from the host computer to the microcontroller card. The control algorithm processes the input signals and produces appropriate signals for the power converter based on instantaneous electric grid consumption. One advantage of such a controller is the fast motor response and high electric torque production.
Real electric load varies asymptotically, and it consists of the active and reactive parts. Apparent power represents the total electric power value considering the angle between voltage and current. As this project aimed to synchronize the DE production with demanded mechanical torque applied on the DE shaft, for the mathematical calculations, only the active power was considered; the apparent power was not calculated. In addition, the instantaneous calculation of active power reduced the complexity of the control algorithm and resulted in a fast microcontroller response.  The proposed algorithm plan ( Figure 6) was implemented in the microcontroller. Small ADC cards were integrated with motor peripherals to reduce application complexity and increase reliability. The motor terminals were connected with the microcontroller using the VFD. The algorithm showed a rapid time response by using high-sampling frequency and different control loops. Moreover, these control schemes reduced switching noise by giving a precise signal to the VFD.
3. Rules and Conditions. The final step before sending the voltage signal to the VFD input is to compare the load power with the predetermined thresholds. Three different load power intervals define the ideal speed condition into the control algorithm as follows. The goal of having such conditions was to adapt the main application (VSDG) with the load variation. Therefore, during a low electric load, the diesel engine slows down to avoid producing unnecessary mechanical torque. On the other hand, the AC motor with the robust control algorithm starts compensating for the required speed for the stator of the electrical generator.  Table 1 reproduce the response data of the control algorithm using different pure resistive load values. These responses were from the motor speed and VFD output. I axis is a state-space model created in the workspace, and the time axis is an indicator to demonstrate the sampling time on which motor reaction was evaluated. More precisely, Table 1 shows the specific speed and active power of the electric load separately for every graph.
Energies 2020, 13, x FOR PEER REVIEW 9 of 15 The proposed algorithm plan ( Figure 6) was implemented in the microcontroller. Small ADC cards were integrated with motor peripherals to reduce application complexity and increase reliability. The motor terminals were connected with the microcontroller using the VFD. The algorithm showed a rapid time response by using high-sampling frequency and different control loops. Moreover, these control schemes reduced switching noise by giving a precise signal to the VFD. 3. Rules and Conditions. The final step before sending the voltage signal to the VFD input is to compare the load power with the predetermined thresholds. Three different load power intervals define the ideal speed condition into the control algorithm as follows. The goal of having such conditions was to adapt the main application (VSDG) with the load variation. Therefore, during a low electric load, the diesel engine slows down to avoid producing unnecessary mechanical torque. On the other hand, the AC motor with the robust control algorithm starts compensating for the required speed for the stator of the electrical generator.  Table 1 reproduce the response data of the control algorithm using different pure resistive load values. These responses were from the motor speed and VFD output. I axis is a statespace model created in the workspace, and the time axis is an indicator to demonstrate the sampling time on which motor reaction was evaluated. More precisely, Table 1 shows the specific speed and active power of the electric load separately for every graph.    Figure 8 focuses on the transient effect of the load variation on different parameters of the AC motor. In this scenario, the electric load increased one-step from 300 to 500 W per each phase. Figure 8a represents the required time for the control application to regulate the motor speed based on the load variation. Figure 8b indicates the VFD output voltage during the load fluctuation. The results showed an appropriate sine PWM waveform for the induction motor. The fast electromagnetic torque stabilization process appears in Figure 8c. The VFD using DPC and power correction loops programmed on the microcontroller achieved this. Figure 8d illustrates the total harmonic distortion (THD) of the VFD output while the motor was running at 1500 rpm.   Figure 8 focuses on the transient effect of the load variation on different parameters of the AC motor. In this scenario, the electric load increased one-step from 300 to 500 W per each phase. Figure  8a represents the required time for the control application to regulate the motor speed based on the load variation. Figure 8b indicates the VFD output voltage during the load fluctuation. The results showed an appropriate sine PWM waveform for the induction motor. The fast electromagnetic torque stabilization process appears in Figure 8c. The VFD using DPC and power correction loops programmed on the microcontroller achieved this. Figure 8d illustrates the total harmonic distortion (THD) of the VFD output while the motor was running at 1500 rpm.

Implementation and Experiments
The control algorithm operated on the FDRM-KL25Z signal processor board. The load power tracking control strategy and DPC-PWM were used in this application to achieve a fast and reliable response of motor speed. The experimental setup appears in Figure 9. Table 2 gives more details of the motor speed control application.

Implementation and Experiments
The control algorithm operated on the FDRM-KL25Z signal processor board. The load power tracking control strategy and DPC-PWM were used in this application to achieve a fast and reliable response of motor speed. The experimental setup appears in Figure 9. Table 2 gives more details of the motor speed control application.  As a variable speed diesel generator uses an AC motor to rotate the generator's stator, we used a synchronous generator as a mechanical load for the induction motor instead of the rotating stator. The induction motor and the synchronous generator were coupled. Consequently, the mechanical load applied on the AC motor shaft varied by changing the electrical load connected to the synchronous generator. The induction motor was equipped with rotor damper winding to limit induced voltage and increase motor torque. The controlled system supplies 208 V at 50/60 Hz and operates at three different rpm steps. In this experiment, electrical loads were manually changed to see the reaction of different components and simultaneously monitor the motor behavior and the control algorithm.  As a variable speed diesel generator uses an AC motor to rotate the generator's stator, we used a synchronous generator as a mechanical load for the induction motor instead of the rotating stator. The induction motor and the synchronous generator were coupled. Consequently, the mechanical load applied on the AC motor shaft varied by changing the electrical load connected to the synchronous generator. The induction motor was equipped with rotor damper winding to limit induced voltage and increase motor torque. The controlled system supplies 208 V at 50/60 Hz and operates at three different rpm steps. In this experiment, electrical loads were manually changed to see the reaction of different components and simultaneously monitor the motor behavior and the control algorithm.

Results and Discussion
The results below indicated the response of a 2 kW induction motor during the electric load step variation. The three-phase Fluke multimeter analyzer measured the power quality of the VFD output and motor frequency. In Figure 10, we present the results for two different load power levels. For the first step, the 482 W electric load per phase was applied to the synchronous generator. Based on the conditions defined on the controller, the AC motor speed increased to 1497 rpm. This behaviour proved that motor speed variation followed the control algorithm. While the experiment was running, the electric load was manually reduced to 295 W per phase. Consequently, the control program increased motor speed to 1798 rpm to meet the predetermined operating conditions. Therefore, during low load values, the VSDG speed control was able to compensate for the necessary rpm while the diesel engine slowed down. Figure 10 (a1, b1) represent the motor frequency response, as dictated by the control algorithm conditions. The green and blue graphs shown in Figure 10 (a2, b2) are voltage and current signals coming from signal limiters apparatuses. The pink graph indicates a reference signal produced by the microcontroller itself. The yellow graph shows the load current used by the microprocessor to calculate the instantaneous power.
Energies 2020, 13, x FOR PEER REVIEW 12 of 15 The results below indicated the response of a 2 kW induction motor during the electric load step variation. The three-phase Fluke multimeter analyzer measured the power quality of the VFD output and motor frequency. In Figure 10, we present the results for two different load power levels. For the first step, the 482 W electric load per phase was applied to the synchronous generator. Based on the conditions defined on the controller, the AC motor speed increased to 1497 rpm. This behaviour proved that motor speed variation followed the control algorithm. While the experiment was running, the electric load was manually reduced to 295 W per phase. Consequently, the control program increased motor speed to 1798 rpm to meet the predetermined operating conditions. Therefore, during low load values, the VSDG speed control was able to compensate for the necessary rpm while the diesel engine slowed down. Figure 10 (a1, b1) represent the motor frequency response, as dictated by the control algorithm conditions. The green and blue graphs shown in Figure 10 (a2, b2) are voltage and current signals coming from signal limiters apparatuses. The pink graph indicates a reference signal produced by the microcontroller itself. The yellow graph shows the load current used by the microprocessor to calculate the instantaneous power.
(a1) (b1) (a2) (b2) Figure 10. Results for the 2 kW AC motor speed control application using the FDRM-KL25Z DSP card; (a1, b1) motor frequency response to sudden increase/decrease of electric load; (a2, b2) voltage (green) and current (blue) response to sudden increase/decrease of the load (reference signal of microcontroller in pink and load current in yellow) Table 3 indicates the CM and VFD behavior during electric load switching process between the two conditions defined in the control algorithm implemented in a microcontroller. The three-phase power and its corresponding frequency for different loads appear below. Precise speed adjustment for the CM was achieved using load consumption tracking strategy. Power factors, currents, and harmonics were received from the VFD, and load power was measured separately from the load panel.  Figure 10. Results for the 2 kW AC motor speed control application using the FDRM-KL25Z DSP card; (a1,b1) motor frequency response to sudden increase/decrease of electric load; (a2,b2) voltage (green) and current (blue) response to sudden increase/decrease of the load (reference signal of microcontroller in pink and load current in yellow). Table 3 indicates the CM and VFD behavior during electric load switching process between the two conditions defined in the control algorithm implemented in a microcontroller. The three-phase power and its corresponding frequency for different loads appear below. Precise speed adjustment for the CM was achieved using load consumption tracking strategy. Power factors, currents, and harmonics were received from the VFD, and load power was measured separately from the load panel.

Experimental Validation
This section presents a comparison between the numerical and experimental simulations of the 2 kW induction motor speed control application. The numerical simulation used MATLAB/Simulink environment following the algorithm described in Section 6.
In Table 4, we present the target speed values of the AC motor for each load and a comparison between the achieved values of the rpm using numerical and experimental approaches. The comparative analysis of load vs rpm showed reliable performance of the control algorithm. During the operation of the test bench, the motor speed increased and decreased several times according to predetermined load variation. Each time, a steady state condition was achieved within 1-3 s, which demonstrated a good synchronicity between the VFD and controlled program in producing electromagnetic torque. This response time showed that the AC motor speed adjusted rapidly in the case of a sudden load change. Finally, the fast and robust response of the AC motor to the load variation resulted in minimum electric disturbances at the VSDG output and motor shaft oscillations.

Conclusions
One of the solutions to increase electricity production efficiency using gensets is to use VSDGs. A recently developed technology uses a rotating stator as a solution to allow the diesel engine to slow down and operate at better efficiency with reduced loads. An AC compensator motor drives the generator's stator and adjusts its speed according to the VSDG electric load such that the stator speed increases when the VSDG electric load decreases. In this paper, we developed a control algorithm for the AC compensator motor that follows the load variation. The numerical and experimental results demonstrated an efficient and robust control algorithm. The main advantages for introducing this control approach with the rotating stator VSDG technology are the increased efficiency operation and reduced fuel consumption and GHG emissions of the diesel engine. The fast time response of the AC motor ensures current quality without the use of complex power electronics.

Conflicts of Interest:
The authors declare no conflict of interest.

Abbreviations
The following abbreviations are used in this manuscript: