A High-Performance and Cost-Effective Field Programmable Gate Array-Based Motor Drive Emulator

This work presents a hardware-based digital emulator capable of digitally driving a permanent magnet synchronous machine electronic setup. The aim of this work is to present a high-performance, cost-effective, and portable complementary solution when new paradigms of electronic drive design are generated, such as machine early failure detection, fault-tolerant drive, and high-performance control strategy implementations. In order to achieve the high performance required by the digital emulator, the electronic drive models (permanent-magnet synchronous machine, voltage-source inverter, motor-control strategy) are digitally described in Verilog hardware description language and implemented on a field programmable gate array (FPGA) digital platform using two approaches: parallel and sequential methods. The results obtained show the effectiveness of the digital emulator design, and the resources used by the solution presented can be implemented on a low-cost digital platform that reveals a cost-effective operation of the solution presented.


Introduction
Due to the high performance, high power density, and time-to-market control strategies designed for it, permanent magnet synchronous machines (PMSM) are widely used nowadays.These machines are implemented in several industrial applications, such as robotics, electric traction, power generation, etc. [1].
Recently, new paradigms of electronic drive design have been developed in areas such as machine early failure detection, fault-tolerant drive, and high-performance control strategy implementations.For example, an extensive analysis of the fault conditions in induction machines is presented in [2,3] for broken rotor bars and bearing faults, respectively.These fault conditions are examined and modeled to present experimental results that show the benefits of early fault detection applied to the induction machine when several kinds of fault detection algorithms are implemented to detect the fault condition.Note that these algorithms require several sessions for data acquisition due to the amount of information needed to detect the fault condition.Also, in [4], a real-time fault detection for PMSM is presented.Here, the control strategy works along with the fault detection algorithm.A combination of digital signal processor (DSP) and FPGA is used to implement the control system where the DSP is responsible for the control strategy while the FPGA is used to implement a fast Fourier transform (FFT) to detect the spurious harmonics related to a fault applied; in this case, a connector fault is simulated, adding a 10 Ohm resistor in the machine phase.This work presents experimental results where the fault is detected when a predefined threshold for a particular harmonic is detected.In future work, different fault conditions are evaluated, such as inter-turn short-circuits.
These new electric machine drive paradigms increase the validation process efforts due to the adverse scenarios or extreme boundary conditions needed to verify the system's performance.These new paradigms present the opportunity to change the design methodology, where electronic platforms can be used to create digital models of the target system, exit it by regular and extreme conditions in a safe manner, and use this information to validate the system designed, efficiently, in the real world.In this case, the simulator and emulator platforms are used to overcome the validation drawbacks mentioned when the electronic drive design is generated.
The software-based simulator and hardware-based emulator concepts are presented in [5].The software-based simulator works with the main characteristics of the target system dynamics, allowing for the generation of a significant fast design process.On the other hand, the hardware-based emulator has the advantage of working with the actual hardware where the critical system properties can be described and implemented, giving inherent robustness and reliable characteristics in the system-level implementation.
A software-based simulator or hardware-based emulator methodology must be implemented according to the target system characteristics and the critical system information to be validated.Several works present solutions for simulator/emulator systems focused on electric machine drives.In [6], a simulator/emulator system is presented for induction machine fault analysis using software-in-the-loop (SIL).The SIL methodology is implemented on a dedicated computer where the induction machine model and fault detection algorithms are programmed and simulated in software for extended analysis.In [7], the optimal sampling time of a model-based predictive control strategy in an induction machine is presented using processor-in-the-loop (PIL).The PIL methodology allows one to program the target system in software and implement it in a DSP.
However, this kind of simulator/emulator system is implemented on dedicated digital platforms, making them susceptible to hardware and software support obsolescence.
In [8], an extensive study of the hardware-in-the-loop (HIL) platforms for electric machine drives is presented.The conceptual design to generate an HIL is described, and a detailed flow model-based design is analyzed.The HIL is a methodology that allows for the emulation of the entire control systems as well as the individual design stages.This generates a reduction in system execution interval and financial resources.This work also makes a review of several hardware platforms as computer-dedicated systems where specialized hardware and software are the fundamental parts of the HIL and the emulator realization.
A hardware emulator has the advantage of being also used in the physical validation as well as the system-level implementation.Several works have generated this kind of FPGA-based emulator focused on electric machine drives as follows.
A real-time emulator FPGA-based implementation of an induction machine is presented.The model is described in very high-speed integrated circuit hardware description language (VHDL) and implemented in an Intel Cyclone II EP2C70F672C6N [9].In order to demonstrate its effectiveness, this design is generated with different fixed-point representations, giving an error accumulation analysis and the methodology to determine the sampling time and the integration method for the machine model.
A HIL evaluation of a PMSM drive is generated using XSG-Matlab/Simulink as platform description and implemented in a Xilinx Zedboard-Zynq development kit [5].
Here, the field-oriented control strategy is implemented along the PMSM digital model.
A real-time HIL implementation for a PMSM is generated using Matlab/Simulink and Altera DSP builder as design interface and implemented in Intel Cyclone III + Texas Instruments TMS320F28335 [10].The aim of this work is to present the entire electronic drive model, including the PMSM model and the voltage source inverter (VSI) model in the FPGA.
A real-time HIL implementation for a PMSM is generated, operating in healthy conditions and with stator winding inter-turn faults using the Labview interface and implemented in the NI sb-RIO platform based on Xilinx Zynq-7010 SoC [11].The fault injection is generated with a finite element approach model.
An HIL implementation for a brushless DC machine (BLDC) is generated using Typhoon HIL Schematic Editor version as the design interface and implemented on a dedicated Typhoon platform [12].This work presents an implementation of cascaded linear controllers tuned by genetic algorithms applied to a BLDC in traction application.
An FPGA-based emulator has the portability characteristic, i.e., it can be implemented on several kinds of FPGA chip, with enough resources to handle the emulator design, no matter the fabrication technology or the fabrication company.However, the digital implementations of the related works reviewed avoid the portability characteristic due to the specialized software and hardware platforms used.In this work, an electric machine drive emulator is designed; a digital PMSM model, digital power electronics model, and novel control strategy are developed and described in Verilog hardware description language (HDL) using two different design methods: parallel and sequential.The entire system is implemented and validated in an FPGA-based platform obtaining satisfactory results in the electronics drive design scenario.The main contribution of this work is to present an FPGA-based electric machine drive emulator with high-performance, cost-effective, and portability characteristics.

1.
PMSM.The permanent magnet synchronous machine is a variant of a three-phase synchronous machine where the rotor magnetic field is applied by permanent magnets placed around the rotor shaft of the machine.The machine dynamics is described in (1)-( 9) as follows.u d,q , i d,q and ψ d,q are the voltage phasor components, current phasor components, and flux phasor components of the machine, respectively.R s , L s , ψ f , and P p are the machine parameters: stator resistance, stator inductance, permanent magnet flux, and number of pole pairs, respectively.The ω m , ω e , M e , M l , and J are the mechanical and electrical rotor speed, electromagnetic and load torque, and the moment of the inertia, respectively. ) ) ) VSI and PSU.The voltage source inverter is the device needed to connect the power supply unit (PSU) and the electric machine.In this case, a three-phase and two-level configuration is implemented in the emulator design, which is generated with three parallel half-bridge discrete power devices.The VSI generates six active voltage phasors (AVSV) and two zero-voltage phasors (ZVSV); see Figure 1.According to the phasor selected, the machine is powered, as can be observed in Figure 2 when the voltage phasor S1 is selected.The voltage phasor selection is commanded by a digital platform according to the modulation generated by the control strategy.Table 1 shows the behavior of the voltage phasors in the VSI.

PWM Generator
The pulse width modulation generator is the block responsible for sending the gate combination to the VSI.There are six signals, one bit each, to send to the three half bridges in the VSI: the top section (gate a,b,c ) and the bottom (gate a,b,c ) section. Figure 3 shows the conceptual design of the PWM generator.In order to obtain the signal modulation, the input signal is compared with a fixed-frequency reference ramp.If the input signal is greater than the reference ramp, the output bit (gate x ) is zero 1 b0; otherwise, the output bit is one 1 b1, while the complementary signal (gate x ) has the opposite behavior.Furthermore, in order to avoid the cross-conduction scenario in the VSI, the PWM generator block implements a dead-band (D b ), where a predefined interval is removed from top and bottom signals to assert the VSI performance; see Figure 4.

Encoder and Quadrature Decoder
The encoder (ENC) block is part of the PMSM design, and it is responsible for sending the information of the rotor mechanical position encoded in two bits (enc a,b ) with a ninetydegree phase.Figure 5 shows the conceptual design of the ENC generator.First, the rotor mechanical position signal is adjusted at a per-unit approach (p.u.).Second, the mechanical rotor position per unit can be rearranged using a digital mask to obtain an even flag; the mask amplitude generates the number of slits in the encoder.The number of events is qualified and used to determine the block output as shown in Tables 2 and 3 for rotor when clockwise and counterclockwise, respectively.
The quadrature decoder (QEP) block is responsible for decoding the information from the ENC block and reconstructing the rotor's mechanical position.First, for each input channel (enc a,b (k)), the current input signals are compared with the previous ones (enc a,b (k − 1)), respectively.The combination obtained increments/decrements are counter with the information of the rotor position signal reconstructed, as mentioned in Table 4.According to the direction information and the counter being greater/lower than a saturation reference, the counter is preset at zero or two pi, respectively.

Angular Speed Control
The angular speed control is a set of three blocks: speed determination (SPD), speed ramp generator (RAMP), and speed linear controller (PI).

1.
SPD.The SPD block is responsible for determining the feedback electrical speed (ω e ) using the electrical rotor position (θ e ).First, this block calculates the difference of electrical rotor position at (k) and (k − 1) instant.Using the fixed step sampling time of the linear-speed controller (T spd ), a first-order low-22pass filter is implemented to determine the actual mechanical speed, as can be seen in ( 10)- (12), where f b is the PMSM base frequency, τ c is the low-pass filter constant (τ c = 2π f −1 c ), and f c is the cut-off frequency of the filter.
RAMP.The RAMP block is responsible for determining the current speed reference to be applied to the linear controller.Starting from zero value, if the input speed requested is higher/lower than internal value, the system starts an increment/decrement in the target speed value at ramp fixed steps (T spd ) as well as SPD block; the increment amplitude (ω e _ f racc) is a constant value entered by the user, and ramp max limit (ramp max ) and ramp min limit (ramp min ) are the highest and lowest value allowed, respectively.The block behavior is presented in ( 13) and ( 14) and Figure 6. ) PI.The speed linear controller is a proportional and integral controller (PI) in a series architecture with an anti-winding-up method.This speed controller is part of the motor control strategy discussed in Section 2.5.First, the proportional term (u p (k)) is calculated with the difference of the reference input (r(k)) and the feedback input (y(k)) and proportional gain K p .Second, the integral term (u i (k)) is calculated using the previous integral information (u i (k − 1)), u p (k) and the integral gain K i .Finally, the auxiliary output v(k) is calculated from the system terms, and the block output (u(k)) is obtained from the saturation verification of v(k); the anti-winding-up signal w(k) allows one to remove the integral calculation if the output saturation is present; see in (15) to (19). Figure 7 shows the operational principle of the speed PI linear controller.Note that integrator sampling time is embedded in the (Ki) gain, which is the same as the other speed subblock (T spd ).

Control Strategy
As mentioned before, the SPC control strategy presented in [13] is used to drive the emulator system.This block is named as a motor control strategy (MSC) block in the following sections.The PCPCC is a model-based predictive control that is performed in the rotatory frame.The whole AVSV(k + 1) and ZVSV are evaluated to determine the one to be applied in the next operating interval (k + 1); for this reason, this strategy works in a fixed sampling time, obtaining activation interval (t on ) values for each AVSV(k + 1).The one that presents the minimum error in the i d,q reference is applied.With this information, the optimal voltage phasor is identified and used to calculate the duty ratio (D ratio ) as ( 20) and (21).
The PDTC is a model-based predictive control that is performed in the stationary frame.The AVSV and a ZVSV are selected according to the cost-function evaluation for the future torque required (M e (k + 2)).As well as PCPCC, this strategy is performed in a fixed sampling time with the advance of implementing the optimal voltage phasor method to evaluate only two possible voltage phasors with two activation intervals (pAVSV[2]@T on [2]).In consequence, the motor control execution interval is reduced.
The SPC implements the optimal phasor voltage method based on the ψ α,β (k + 1); the best two AVSV are identified and used to determine the t on to be applied.The cost function minimization is obtained from the i dq (k + 2) calculation.As a consequence, this approach decreases the operating time interval, keeping the performance of the PCPCC.The SPC block diagram is shown in Figure 8. Calculate the present alpha and beta current phasor components using the three-phase to stationary frame transformation, Calculate the present direct and quadrature current phasor components using the stationary to dynamic frame transformation, Calculate the present electric rotor angle position using the encoder signal, θ e [k].

5.
Calculate the present electric rotor angular speed using the electric rotor angle position, ωe [k].

6.
Calculate the reference for the electric rotor angular speed using the present value set by the user, If T speed is performed, calculate the electric rotor speed command using the linear PI controller, I * d,q .Otherwise, keep the present command.8.
Determine the present alpha and beta voltage phasor components using the present AVSV applied, Calculate the present direct and quadrature voltage phasor components using the present alpha and beta voltage and the present sine and cosine of the electric rotor position, V d,q [k].10.Calculate the future direct and quadrature current phasor components using the forward-Euler approach, I d,q [k + 1]; see [14,15].11.Calculate the future alpha beta flux components using the forward-Euler approach, ψ α,β [k + 1]; see [1].12.Using the future alpha beta flux components, calculate the future angle position, ψ ang [k+1]; see [1]. 13.Using the future flux angle position, determine the future flux sector, ψ sector [k + 1]; see [1].
14. Using the future angle position and the future quadrature current phasor component error, I e [k + 1] (see [14,15]), determine the best two possible voltage phasors, pAVSV (2) [k + 1], [1].15.Determine the future alpha beta voltage phasor components using the information of the two best voltage phasors obtained previously, V α,β [k + 1]; see [1].16.Calculate the future direct and quadrature voltage phasor components using the future alpha beta voltage phasors and the future sine cosine electric position, V d,q [k + 1]; see [14,15].17.Calculate the future, [k + 2], quadrature current phasor component using the forward-Euler approach, I e [k + 2]; see [14,15].18. Determine the voltage phasor to be used in the next iteration and its activation duty ratio to be applied using the cost function, AVSV[k + 1]@t on ; see [16].19.Apply the next voltage phasor and its duty ratio to be performed in the pulse generator.20.Wait for the next iteration.

Digital Design
As mentioned before, a digital emulator can be generated at several hardware platforms depending on the system characteristics, such as available resources precision level, system complexity, execution interval, etc.In this case, an FPGA-based solution is considered due to the amount of operations required to be implemented.The block diagram of the entire emulator proposal is shown in Figure 9.Each block represents part of the modules mentioned in previous sections to generate the electric machine drive for a PMSM.As mentioned in [9], the integration method must be selected according to the execution interval.As long as the execution interval is highest, the integration method is complex.In this case, the emulator is designed using the forward-Euler method due to its inherent simplicity.This method accumulates the information of the last integration signal (y(t − 1)) and the actual input signal u(n) to obtain the signal integration (y(t)) (22).
However, this requires the minimum possible execution interval for the PMSM model.For this reason, two design methods are presented (parallel and sequential) to mitigate the error accumulation due to the low-order integration method selected.Figures 10 and 11 show the behavior of the parallel and sequential methods used to describe the system models in the emulator design, respectively.
The main advantage of the parallel method is the availability to perform operations in the same clock cycle, giving the process result in an instantaneous mode; when this method is applied on the FPGA platform, dedicated hardware elements are configured on the chip.If a large amount of resources is required, the system's maximum frequency is reduced to keep the operation signal integrity due to the distance between the elements on the edge of the design.On the other hand, the sequential method saves resources due to the input and output signal multiplexing with respect to the adders or embedded multipliers in the FPGA platform; however, this method generates an increment in the number of resources required, a look-up table (LUT), and a memory cell (flip-flop), used to multiplex the input and output of the operation blocks.For this reason, the maximum number of multiplexing lines and the total execution interval must be validated in the final implementation.

Designed Emulator
The entire digital emulator is described in Verilog-HDL (digital PMSM model, digital power electronics model, and SPC control strategy).As mentioned before, the forward-Euler integration method is evaluated due to its inherent simplicity.The digital PMSM model parameters are shown in Table 5.The following results are shown in p.u. according to model parameter values.In order to obtain significant information about the solution designed, electronic drive devices (such as a PWM generator with dead-band implementation, a digital VSI model connected to the PSU, and quadrature encoder/decoder for PMSM rotor position detection) are considered as an interface between the digital PMSM model and the digital control strategy.The solution is implemented in the evaluation board NEXYS 4DDR with a Xilinx Artix-7 XC7A100T-CSG324C FPGA at 100 MHz clock source.The system variables are using a 32-bit resolution and a Q24 format for the decimal part.A 12-bit digital-to-analog converter (DAC) is used to visualize the digital PMSM model behavior on an oscilloscope.The Figure 12 shows the system setup connection.In order to determine the minimum execution interval of the digital PMSM model (Texec PMSM ), the parallel description method is used first.Figure 13 shows a Texec PMSM = 540 ns.On the other hand, when the sequential method is implemented, a Texec PMSM = 1 µs is observed; this is due to the increment in clock cycles needed to perform the whole operations in the digital PMSM implementation; Figure 14 shows the execution interval increment in the sequential method.
Figure 15 shows the register transfer level (RTL) of the digital PMSM designed.This RTL contains the of the PMSM equations shown in ( 1 and ω e _p.u.signals to be observed in the oscilloscope.The rest of the outputs are used in the internal MSC block and the ENC block, as mentioned in Figure 9.  Figures 16 and 17 show a zoom of the RTL of the ψ d generation block for the parallel and sequential approach, respectively.Here, the connection differences are noted where the elements used to generate the same block behavior have been changed significantly.Furthermore, in the sequence method connection, the signal multiplexing around the operation block is noted at the block inputs and output.This is verified in the following routing placement evidence. As shown in Table 6, the system designed with the parallel method requires 63.33% of the embedded multipliers, 9.22% of the LUT, and 2.89% of the flip-flop due to the number of calculations performed.However, when the sequential approach is implemented (Table 7), only 47.5% of the embedded multipliers with an increment of 10.17% of LUT and 3.93% of the flip-flop is needed, saving 12% of resources.In the following discussion, the magenta color is used to remark the FPGA chip resources, and the configurable logic block (CLB) is used in the implementations.As can be noticed, the parallel method distributes the CLB along the chip area; see Figure 18.Due to the connection distance between signals, which have to cross all chip sections, a timing degradation in the system connections is generated.This phenomenon is known as worse negative slack (WNS), which is the setup slack of the critical path in the design.If WNS is negative, at least one path in the design does not meet the timing request.
In consequence, the design speed is reduced below the rated source clock.On the other hand, the sequential method compacts the CLB distribution; see Figure 19.This generates a positive WNS, which allows for the use of the rated source with a resource reduction characteristic.

Control Strategy Evaluation
As mentioned before, the SPC control strategy is described and implemented along the digital PMSM model in the emulator solution.Considering a maximum one hundred times faster relation between the digital PMSM model and control strategy execution interval (Ts rate ), the control strategy is implemented on a fixed sampling time of one hundred microseconds (Ts MSC = 100 µs).
A minimum fixed sampling time of one microsecond is implemented for the digital PMSM model (Ts PMSM = 1 µs) in the parallel method.Although the sequential method allows one to reduce the system resources, it presents an 85% increment in the Texec PMSM .For this reason, Ts PMSM = 1.05 µs is used for the sequential method.Due to the benefits obtained, the sequential method is used in the control strategy evaluation.
In order to verify the emulator performance, the control strategy discussed before is implemented in the emulator setup.The evaluation is performed under two conditions to determine the dynamic behavior in the operational range of the PMSM.A ten-second emulation is generated, and it is described as follows: (a) from [0-1.6] s, the speed ramp is applied to reach 0.5 p.u. nominal speed; (b) from [4][5][6][7] s, the 0.5 p.u. nominal torque is activated (see Figure 20).Furthermore, a ten-second emulation is generated, and it is described as follows: (a) from [0-3.1] s, the speed ramp is applied to reach 1.0 p.u. nominal speed; (b) from [4][5][6][7] s, the 0.5 p.u. nominal torque is activated (see Figure 21).In this case, the system presents a relevant difference in the phase-current behavior (Channel 1).The difference observed is generated by the oscilloscope acquisition.This is due to the increment in the phase-current frequency, which is synchronous to the rotor speed (Channel 2).As can be noticed, it is reaching the nominal speed (1 min −1 p.u.) along the phase-current frequency.The results obtained show that the emulator designed can be used in the full operating range of the PMSM rotor speed (system frequency).
Figures 22 and 23 show a zoom of the load applied and a zoom of the load removal dynamic behavior of the digital PMSM model generated, respectively.As can be observed, the angular speed presents an overshoot of 12.5% while the recovery interval is around 63 ms, as configured in the linear-speed controller using the methodology presented in [17].The digital PMSM model designed is evaluated at several sampling time conditions where the phase current shows the performance of the emulator.As can be noticed, an increment in the sampling time of the digital PMSM model entails a smaller number of calculated iterations with respect to the control strategy.This degradation of the performance can be observed in the phase-current behavior at steady-state conditions; see Figures 24-26 for Ts PMSM = [1.05,2.0, 4.0]µs, respectively.Although it is possible to drive the digital PMSM model at different sampling time conditions, the system degradation can be observed until 30% with respect to the maximum number of samples evaluated, where the system diverges in the dynamic condition; see Figure 27.Table 8 presents the results obtained at the sampling time conditions evaluated.An experimental evaluation of the physical PMSM drive is performed.The setup is a variant of the evaluation used in [13]; the emulator design presents similar parameter values as the experimental setup.Figure 28 shows the experimental setup and whole devices needed to complete the electric motor drive.This evaluation presents the operation conditions where the emulator is working.First, the system is driven at 0.5 p.u. nominal speed and a 0.15 p.u. nominal torque is applied.Second, the phase-current U data are saved and evaluated using the fast Fourier transform (FFT) application of the oscilloscope.Figure 29 shows the results obtained from the experimental setup.As remarked in the oscilloscope data, the system frequency is 133 Hz, corresponding to the 0.5 p.u. nominal speed, with an amplitude of −17.2 dB.Also, the same evaluation is performed on the emulator platform.In this case, the system frequency is 133 Hz, corresponding to the 0.5 p.u. nominal speed, with an amplitude of -16.4 dB; see Figure 30.There are some unexpected spurious harmonics around the 1 KHz band, which are undesired if implemented solutions, such as digital filters, are performed in that band.On the other hand, there is a significant difference between the amplitude of the 10 kHz component in the emulator and the corresponding in the experimental setup.In order to determine the accuracy of the emulator with respect to the experimental setup, a harmonic distortion analysis is performed using the phase current of both evaluations and the Matlab R2022b and its signal processing toolbox.Table 9 presents the results obtained from the harmonic distortion evaluation at 133 Hz.The emulator presents approximately three times the distortion factor with respect to the experimental setup due to the spurious harmonics detected.This behavior is related to the integration method and is considered in future work to overcome this drawback.The emulator system responds to the advanced control drive generation use case, and with the proper modifications, can be used in the system fault detection, early-fault diagnosis, and fault-tolerant electronic drive scenarios.Additionally, the mean-square error (MSE) is obtained using (23), where n is the number of samples, i is the actual value evaluated, Y i is the observed value, and Ŷi is the reference value.It is used to determine the average of the squares of the errors between both signals, the emulator, and the experimental setup, respectively.The result obtained is MSE = 0.0043, which is the performance of the system emulator with respect to the experimental setup.In future work, this MSE value will be reduced using other kinds of integration methods of superior order.

Low-Cost Implementation
Finally, considering the resource reduction viability in the sequential method, the digital PMSM design is implemented in a low-cost FPGA.
The DSG_DIG_2V0 custom-made board is a solution for general-purpose digital design implementation.This board presents five sections: the core, analog interface circuit, sensor circuit, main and secondary power supplies, communication ports, and digital user interface.

1.
The core.This is an FPGA-based digital processing chip.The FPGA obtains the digital signals to process and send the calculations performed according to the control strategy.The peripherals around the FPGA are driven by the digital core.The general purpose input and output (GPIO) pins are driven by the 3.3 V PSU source.

2.
The main and secondary power supply.The power supply unit is responsible for delivering the energy to the entire board.The main PSU can be configured to 5 V or 36 V as voltage input as needed; this PSU section is capable of driving 3.3 V as the main voltage rail in the board.Here, the secondary voltage rails are generated: 2.5 V, 1.8 V, and 1.2 V rails are generated by power converter units; these rail voltages are needed to drive the FPGA banks and the configuration section.

3.
Analog interface.This is a set of ADC and DAC devices that can be used to acquire the system data or send the analog behavior outside via oscilloscope, respectively.These devices are driven by the 3.3 V PSU where the relative p.u. relative signals are scaled.These devices are driven by a serial peripheral interface (SPI) communication protocol as a slave device, where the FPGA is the master SPI device.4.
The sensor.In this case, the DSG_DIG_2V0 custom-made board is available to read its own temperature via a temperature sensor driven by an inter-integrated circuitserial (I2C) communication protocol.This dedicated peripheral can also be used in general-purpose devices via an expansion connector.5.
The communication port is a set of programming devices as well as the universal asynchronous transition (UART) converter port.First, the programming port is responsible for the main configuration of the FPGA; this transmission is generated via a joint test action group (JTAG) protocol using a Terasic™ USB-Blaster. .Second, a converter from UART to the universal serial bus (USB) is integrated to generate the link from the DSG_DIG_2V0 and the external host.6.
The digital interface.This section is a set of buttons and light emission diode (LED) indicators.The main purpose of this section is to provide the designer with a direct link with the board for debugging porpoises.
The general block diagram of the DSG_DIG_2V0 custom-made board is shown in Figure 31.Also, the conceptual board specifications are shown in Table 10.

Figure 5 .
Figure 5. Encoder operational principle.The example shows eight slits per revolution.

Figure 8 .
Figure 8. SPC block diagram.The control algorithm is described as follows: 1. Calculate the present and future sine and cosine of the electric rotor position, sin(θ e [k]), cos(θ e [k]), sin(θ e [k + 1]), cos(θ e [k + 1]).2.Calculate the present alpha and beta current phasor components using the three-phase to stationary frame transformation,I α,β [k].3.Calculate the present direct and quadrature current phasor components using the stationary to dynamic frame transformation,I d,q [k].4.Calculate the present electric rotor angle position using the encoder signal, θ e [k].5.Calculate the present electric rotor angular speed using the electric rotor angle position, ωe [k].6.Calculate the reference for the electric rotor angular speed using the present value set by the user,ω * e [k].7.If T speed is performed, calculate the electric rotor speed command using the linear PI controller, I * d,q .Otherwise, keep the present command.8.Determine the present alpha and beta voltage phasor components using the present AVSV applied, V α,β [k].9.Calculate the present direct and quadrature voltage phasor components using the present alpha and beta voltage and the present sine and cosine of the electric rotor position, V d,q [k].10.Calculate the future direct and quadrature current phasor components using the forward-Euler approach, I d,q [k + 1]; see[14,15].11.Calculate the future alpha beta flux components using the forward-Euler approach, ψ α,β [k + 1]; see[1].12.Using the future alpha beta flux components, calculate the future angle position, ψ ang [k+1]; see[1].13.Using the future flux angle position, determine the future flux sector, ψ sector [k + 1];see[1].

Figure 9 .
Figure 9.General block diagram of the digital emulator proposed.

Figure 10 .
Figure 10.Design architecture in parallel method.

Figure 11 .
Figure 11.Design architecture at sequential method.
)-(9).As can be observed, the blocks and connections represent the operations needed to implement the PMSM model.The input signals V a,b,c , trg_load, and trg_load_reg are used to power the PMSM, determine the load torque value, and trigger the load torque in the PMSM, respectively.The rest of the input signals are used in the implementation structure.The output signals dac_data_ch0 and dac_data_ch1 are used to drive the DAC device with the I a _p.u.

Figure 15 .
Figure 15.The RTL schematic of the digital PMSM model designed in the sequential method.

Figure 16 .
Figure 16.The RTL schematic zoom of ψ d transformation block, parallel method.

Figure 17 .
Figure 17.The RTL schematic zoom of ψ d transformation block, sequential method.

Figure 18 .
Figure 18.The routing placement of the digital PMSM model designed, parallel method.

Figure 19 .
Figure 19.The routing placement of the digital PMSM model designed, sequential method.

Figure 33 .
Figure 33.The RTL diagram of the digital power electronics model designed on Intel-Cyclone 10LP.(a) Full implementation and (b) zoom to the RTL diagram of the digital PMSM model.

Table 5 .
Parameters of the PMSM model.

Table 6 .
Digital emulator resources summary, parallel method.

Table 7 .
Digital emulator resources summary, sequential method.

Table 8 .
Phase-current signal degradation with respect to PMSM sampling time.

Table 9 .
Harmonic distortion evaluation of the experimental and emulator setup at 133 Hz.

Table 10 .
Block diagram of the DSG_DIG_2V0 custom-made board.Specifications of the DSG_DIG_2V0 custom-made board.