**ABSTRACT**

This report describes the work of developing a rapid prototyping system for Permanent Magnet Synchronous Motors using LabView FPGA at ABB Corporate Research in Västerås. The aim of the rapid prototyping system is to serve as an additional tool to simulation when evaluating new control algorithms for mechatronic applications. Using LabView FPGA, Field Oriented Control is implemented for a single axis and a multi axis system on the sbRIO 9632 development board from National Instruments. The aim is to develop a controller for multiple axes while optimizing the use of system resources.

The report presents the work of testing and evaluating the implementation of the single axis system. The system will be tested in a laboratory test bench to verify its performance. The laboratory results are compared and verified against MATLAB/Simulink simulations of the system. Using the results from the single axis tests as a benchmark the multi axis system is verified and evaluated.

The implemented systems proved to provide good regulation of the motor currents for both the single axis and the multi axis system.

**SYSTEM HARDWARE**

Two shunt resistors are connected in series with two outputs of the inverter bridge that connects to phase U and V of the motor. The phase currents are obtained through measurements of the voltage difference across the shunt resistors. These voltage differences are converted into two 12 – bit digital signals through a two channel analog to digital converter (ADC). The currents passing through the phases are then calculated by Ohms law. The ADC data can only be acquired from the built in SPI communication bus. The board can be viewed in Figure 6.

**IMPLEMENTATION**

Both systems, i.e. the single axis system and the multi axis system, are designed using the components described in section 4.1.1 to section 4.1.7. The systems are designed as several loops executing in parallel. The communication between the loops is handled by dedicated memory areas in the block RAM memory, see Figure 7. For a rapid prototyping application it’s important for the user to be able to interact with the controller.

In the second frame all data to be used in the calculations are read from the input block RAM memories and the front panel, i.e. current data, resolver data and user data. The Clarke and Park transformations are also performed. To interface the inverter bridge and the sensors to the FPGA the components described in section 4.1.7 are included in three parallel loops as sub VIs, see Figure 23. A separate loop is implemented to turn the inverter on and off and change the dead time at runtime.

The design of the multi axis system follows the same design principle as the single axis system with several loops executing in parallel. To save resources on the FPGA the scaling of resolver data and current data has been moved from the separate VIs to two scaling loops, as can be seen in Figure 28.

**SIMULATION**

Nevertheless, the basic principles are the same. Another difference is that the block uses the alpha and beta components directly as inputs instead of the I_{d} / I_{q} components generated by the inverse Clarke transform. Thus, the model will not include the inverse Clarke transform in the simulations. The inverse Park transform is however needed to transform the variables back from the rotating frame into the stationary frame and can be seen in Figure 47.

The feed forward controller is based on the equations from section and is just a simple model to simulate the outcome in terms of V_{d} and V_{q} for different sets of I_{q_refs} and speeds. The V_{d} and V_{q} components will be verified against the implemented system for the same inputs. The subsystem and the block diagram of the block can be seen in Figure 48 and Figure 49 respectively.

**TESTING**

To test and verify the implemented FOC – algorithm and its performance, a mechatronic test bench will be used. The test bench comprises an in – line torque transducer (TM302/011) and a hysteresis brake (HB – 140M – 2) which are both provided by Magtrol. The motor shaft is extended and connected to the dynamic brake and the torque transducer through three couplings, see Figure 50. The couplings protect the torque transducer and the dynamic brake from over – torque generated by the motor intest.

The PWM period is currently set to 1000 ticks. This means that the pulses from the SVPWM generator have a frequency of 40 kHz. The length of the pulse will however be much shorter than 40 kHz for the shortest pulse. To guarantee that the MOSFETs deliver the right amount of current during one switching period, i.e. the time from when the drain – to – source voltage starts to fall (Tdon) until it has reached 90% of its end value (Tr). See Figure 52.

**RESULTS**

The first hypothesis on what may be the source of the disturbances was erroneous behavior in the PI controllers. Therefore, a test was made when manually entering the V_{d} and V_{q} values. The test showed that the disturbances remained. However, since no PI controllers were used the current did not increase uncontrollable before it settled, see Figure 78.

To verify the performance of the controller, the multi axis controller was executed and tested at different speed and I_{q} reference values. Motor one was fitted in the test bench motor two was running freely on the desk. Several parameters were monitored and compared to the results from the single axis system, As can be seen in Figure 79, the torque versus speed profile for the motor fitted in the test bench is identical to the single axis system for different I_{q}. This proves that no performance is lost when adding multiple axes.

**DISCUSSION**

By using this setup, the benefits of a rapid prototyping approach when developing control algorithms has been shown. The system has shown great transparency since all data in the system can be monitored and verified in several ways. The motor currents can be monitored by using LabView and compared to the results from both the power analyzer and the oscilloscope. They can also be verified by monitoring the signals in the system, i.e. I_{d} / I_{q} and V_{d} / V_{q}, to derive an expected result. Simulations of the system can prove the validity of the results.

**CONCLUSIONS**

This report has shown a method to control multiple axes individually using one single FOC loop without losing performance in the controller. However, due to problems with the timing on the FPGA no more than two motors were controlled. If optimizing the fixed point representation throughout the system it is likely to believe that four motors can be controlled using the sbRIO – 9632 board. The current solution allows control of up to four motors simultaneously in terms of hardware. Due to the limitation of digital I/O’s, one motor requires 24 I/O s, on the NI sbRIO – 9632 board four motors is the maximum number allowed.

To verify the performance of the systems a number of motor parameters stated in the datasheet were investigated. The rated torque, rated power and rated speed were tested along with the torque constant and stall torque in the test bench. As has been shown, the systems are able to deliver rated torque, rated power at rated speed and at an I_{q} of 4,05 A which is about 15% lower than rated current provided by the datasheet.

It is highly likely that this is a result of the inverter used. The calculations showed that there is an average difference factor of 1,8 between the theoretical and measured torque constant. Unfortunately, the authors of this report have not found any good explanation to this. The stall torque was difficult to derive using the setup described in this report but has been estimated from the trend of the rated torque curve from the torque/speed profile to 105 mNm.

**Future Work**

To further improve the systems a series of actions can be taken.

- Numerical analysis of fixed point configurations. Investigate how small the variables in the system can be without losing data due to overflow or too poor accuracy. The total error in the system induced by the fixed point representation should also be investigated
- Investigate maximum loop frequency allowed by the PI blocks
- Include support for different types of motors in the multi axis system. The current version of the controller only supports that two similar motors are being controlled.
- Perform more thorough testing of multi axis system
- Design more intuitive front panels for both systems
- Test the controller at different sampling frequencies and PWM frequencies.
- Perform a frequency response analysis to derive the system bandwidth.

Source: Mälardalen University

Authors: Joakim Eriksson | Luciano Hermansen

>> Top 50+ MATLAB based Simulation Mini Project Topics & Final Year Project Titles for ECE Students

>> Simple Matlab Projects for EEE Final Year Students

>> Best Matlab Project Ideas for Engineering Students with Full Project Materials

>> Simulink Projects using Matlab for Engineering Students

>> **More Matlab Projects on Signals and Systems for Final Year Students**

>> **200+ Matlab Projects based on Control System for Final Year Students**

>> **80+ Matlab Projects based on Power Electronics for Engineering Students**

>> **More Analog Communication Projects using Matlab for Final Year Students**