## 1 Introduction
These studies [15; 16] used a multilayer feedforward configuration; this method has a disadvantage in that feedback data from previous positions cannot be obtained. To overcome this weakness, this paper proposes a scheme that utilizes feedback information--the previous value of the output layer--to represent the last rotor angle. Figure 1 presents the architecture of the sensorless PMSM-FOC developed in this study. The startup process was performed using the Volt/Hz open-loop control method [19; 20; 21; 22; 23]. When the motor was operated at a low speed (for example, less than 400 rpm), it rotated in an open loop (switch mode 1). Thus, when the speed reference was set to a value greater than 400 rpm, the motor speed ramp up in an open loop until it reached 400 rpm. Switch mode 2 was then used, enabling a closed-loop sensorless control mode for speeds exceeding 400 rpm. ML with the Elman NN (ENN) basic architecture was used in this study. The ENN includes a context layer to store an internal state; thus, it is more dynamic than the multilayer perceptron architecture [24]. The ENN can be considered to have additional memory neurons and local feedback [25]. Since its introduction in 1990, the ENN has been widely used in various fields [26; 27; 28; 29; 30], and many efforts have been made to optimize its performance [31; 32; 33]. Figure 2 presents a block diagram of the modified ENN. The dashed line indicates the feedback portion of the original ENN algorithm; the previous network output value is fed back to the input layer. This modified part is also the novel contribution of this work. The inputs are voltages and currents in the \(\alpha\)-\(\beta\) axes (\(v_{\alpha}\), \(v_{\beta}\), \(I_{\alpha}\), and \(I_{\beta}\)). The targeted outputs are the sine and cosine of the rotor-position angle \(\theta\). Figure 1 indicates that information about the rotor speed \(\omega_{\epsilon}\) is also required during the FOC process. Consequently, in the ML-based observer block, the modified ENN, is combined with a phase-locked loop (PLL) to determine \(\theta\) and \(\omega_{\epsilon}\). The PLL has been widely adopted to enhance estimator quality [11; 18; 34; 35]. MATLAB 2021b was used to develop the modified ENN algorithms, design and simulate the control schemes, generate the embedded code for hardware implementation, and control and retrieve data from experimental platforms. As a part of MATLAB, Simulink has a Motor Control Blockset that contains several fundamental motor-control function blocks, such as the Clark and Park Transformations, space vector generators, and electrical system models, such as those for inverters and motors [36]. Thus, motor-control simulations can be performed rapidly, precisely, and accurately. Because of the precision and accuracy of the simulation data, ML models trained on these data are thought to perform well when implemented on real hardware. The present experimental results were obtained using a hardware control platform based on digital signal processors (DSP) from Texas Instruments (TI). The platform was developed with MATLAB's embedded coder support package, which can efficiently create a control algorithm from a Simulink model [11; 37]. ML has high computational demands; thus, determining the sample time was critical to the success of the hardware implementation. Figure 1: Proposed sensorless permanent magnet synchronous motor field-oriented control (PMSM-FOC) architecture. Figure 2: Modified Elman neural network (ENN) block diagram. The following steps were performed to develop the model:  
* An ML-based observer-training algorithm was developed on the basis of the modified ENN. * Training and validation data were recorded from the sensored PMSM-FOC digital simulation performed with Simulink. * The ML-based observer was trained and validated using the recorded data. * The validated ML function block was implemented in a Simulink simulation for a sensorless PMSM-FOC. * The ML-based observer was realized in a DSP-based hardware control scheme.