Spinning two PM machines simultaneously with sensored FOC using real-time embedded software Altair Embed®

Spinning two PM machines simultaneously with sensored FOC using real-time embedded software Altair Embed®
Prof. Dr. Ir. Duco W. J. Pulle
Chief electrical drive consultant for Altair
Summary
This blog demonstrates dual FOC controlled PM machines connected together and controlled by a single F280049C processor. Full embedded motor control provides speed or torque control of both machines. This model gives remote user access to the drive, in order to explore four quadrant drive operation by examining shaft speed, torque, and input power readings. In addition, online voltage and current scopes are present to further enhance didactic understanding for this type of drive.
Introduction
A dual electrical drive, consist of two electrical machines of which the respective rotors are coupled together, as shown in figure 1. The (assumed) primary machine with inertia defines the shaft speed
as the rotors are rigidly coupled together. The rotor of the secondary machine with inertia
can be the same type of machine as the primary, as is the case here. However, the secondary machine can be simply a mechanical load with shaft torque that usually opposes the shaft torque
generated by the primary machine. In this case both machines with their respective controllers are PM Synchronous, as shown in figure 2 and discussed in my previous “PM Synchronous BLOG”. Both machines are provided with an encoder that generates the shaft angle
for the PM flux vector
to implement field-oriented control (FOC) by controlling the amplitude and orientation of the current vector, to set the desired torque levels. For example, if the primary machine is configured as a motor, then the product
is POSITIVE. If the secondary machine is set to operate as a generator (or more commonly referred to as a “dynamometer” the product
is negative. The directional speed is the same hence motor /dyno operation is dictated by the polarity of the torque set by the controllers of the dual drive.
The dual electrical drive shown in figure 3, consists of the processor (MCU) that houses the control algorithms and all the functionality needed to use the measured current/voltages and also generate the PWM signals for both converter modules. Phase currents are measured using in-line sensors and low-pass filters (LPF) are used to measure the converter output voltages and eliminate the PWM component. The 12 bit ADC unit digitizes the incoming voltages/currents and these are sent to the “Forward Clarke” modules that generate the motor current/voltages in stationary coordinates as shown in the vector plot in Figure 4a, 4b. These variables together with the measured DC bus voltage and most importantly the shaft angle decoder signals are required for the “Controller” and “FOC Data” (FD) modules.
The purpose of each FD module is to track the PM rotor flux vector and orientate the controller
synchronous coordinate system as shown in the FOC vector plot. This requires instantaneous knowledge of the angle
and amplitude
(required to calculate the torque). The flux speed
, is calculated from the angle
.
Each controller module consists of a synchronous current (see our book Applied Control) and speed controller, where use is made of the measured current vector , flux angle and electrical shaft speed. Torque control requires control of the current
and a shaft torque estimate is found using
, where
is the PM flux amplitude which is identical ( in terms of amplitude) for both machines. An illustrative operational example sets the primary machine operating under FOC speed control and the secondary operating as a ‘dynamometer’ , i.e. operating under torque control, which is precisely what is shown in figures 4a and 4b.
With reference to these vector diagrams the following can be deduced:
On fig 4b: which represents the secondary machine (AC2) operating under torque control (acting as a dynamometer):
- Torque control is set by the user who defines
, in which case the shaft torque is simply
, which requires knowledge of the PM flux vector amplitude
as mentioned above. In this vector plot
is negative hence the secondary torque is negative, thus acting as mechanical load for the primary machine operating at electrical speed
.
- The EMF is defined by the vector
- The voltage across the inductance is defined by the vector
- The voltage across the resistance is defined by the vector
- The phase voltage (as measured via the low-pass filters) is the vector
- The in-product of the two vectors
defines the real input power, which in this case is negative, i.e regenerating (power being returned to the supply)
On fig 4a: which represents the primary machine (AC1) operating under speed control:
- Speed control using a proportional integral (PI) controller is defined as
, with
and ‘s’ the Laplace operator.
The PI output is the reference quadrature current value, which has boundary
limits set by the user. The proportional
and integral gain
are defined by the
drive inertia of BOTH rotors and user defined speed controller bandwidth
(see our book Applied Control).
- Under constant speed operation the speed controller will generate a shaft torque that matches the load torque of the secondary machine. In this case the quadrature current is equal to
.
- The phase voltage (as measured via the low-pass filters) is the vector
- The in-product of the two vectors
defines the real input power, which in this case is positive, i.e. motoring (power being taken from the supply)
For both machines the direct axis current is set to zero, which implies that the two current vectors are in opposition.
Note: a common power supply is used that provides power for BOTH converters.
Many power supplies (as is the case here) have limited (or zero) regeneration capability hence the need to connect both converters, in which case the power supply is only needed to cover the combined losses of the dual drive (mechanical and electrical) .
Experimental HIL
A practical embodiment of the AC drive mentioned above is shown below and consists of an PMsyn Teknic Motor , which has an encoder and a Texas Instruments LAUNCHXL-F280049C with two TI BOOSTXL-3PHGANINV, 12-60V/10A boostpacks. Real-time embedded control from Altair Embed is used to fully control the dual electrical drive FOC sensored .
The motor parameters are: .
You can review the video below, 'Field-oriented control HIL - Dual PM' to learn more about (and run) this drive application.
https://www.youtube.com/watch?v=Cs7ROysopU4
Operational aspects:
- Primary (AC1) speed control, secondary (AC2) torque control: button settings:
- PM1_spdCtrl : ON
- PM1_FOC : ON
- PM2_spdCtrl: OFF
- PM2_FOC : ON
- Slider PM1_spd(RPM): controls shaft speed of primary machine (AC1)
- Sliders: Speed gain Kp and proportional gain Ki, set the speed loop
- Slider PM1_id_ref (A): controls direct axis current of primary machine (AC1)
- Slider PM2_iq_ref (A): controls quadrature axis current of secondary machine (AC2)
- Measurements available:
- Input power measurements of both machines (AC1 , AC2)
- Shaft torque measurement of both machines (AC1 , AC2)
- DC bus voltage measurement of both boostpacks
- On line scope showing per unit currents
, machine AC1 BLUE with Ch1-2
- On line scope showing per unit currents
, machine AC1 BLUE with Ch3-4 ON
- CPU usage: percentage of controller sampling time used
Shaft speed 2: shaft speed of machine AC2 (is equal to AC1 if connected)
Shown below is the Embed run file PMPM_Dual_Sens_phCv1_d.vsm that makes use of the compiled out-file generated by the file: PMPM_Dual_Sens_phCv1.vsm .
Operation is set as described above with a speed reference setting of 1000 rpm. Torque control of the secondary (AC2) machine is set by the quadrature current slider. The primary machine (AC1) operates as a motor with torque 60Nm that is matched by a load torque of -40 Nm generated by the secondary machine AC2. The torque difference between both machine is formed by the friction torque
Also shown is the input power for both machines: positive for AC1 and negative for AC2 (acting in regenerative mode)
The Embed scope shows the per unit currents .The currents for AC1 (shown in BLUE ) AND AC2 are opposite in phase, which is the case here, given that the motor current vectors are set up as shown in figure 4. The quadrature current amplitude of machine AC1 is larger then AC2 in this case given the presence of friction torque.
The experimental setup shown below shows the dual PM-PM drive, which is connected via a USB cable to the laptop that runs the Embed file shown above.
A current probe is used to show the measured phase current of the primary machine on the scope with setting 1A/div. This corresponds with the ‘blue’ current shown in the scope module of figure 7.
The Embed files required to build your own drive, based on this presentation are Dual FOC PM sensored Embed files for TI Launch/boost, which are attached below.
Learn more about Embed through comprehensive help guide : Embed Help
References
- Fundamentals of Electrical Drives, 2nd ed, Veltman A. , Pulle D.W.J. , De Doncker R., Springer 2019,
- Advanced Electrical Drives, 2nd ed , De Doncker R., Pulle D.W.J. and Veltman A., Springer 2020.
About the author
Prof. Dr. Ir. Duco W. J. Pulle
Forty years of experience in electrical drives including 25 as a professor at European Universities, including RWTH-ISEA, Germany, which is the world leader in electrical drives. Author/co-author of three books and numerous conference/journal papers
Over the past fifteen years have been working as a consultant in the field of sensorless electrical drives with a wide range of machine types and power.
My vision and passion is to promote the use of real-time embedded control for electrical drive applications using Altair Embed. For this reason a wide range of application examples has been developed, which covers all machine types and control algorithms.
Educational background: Aviation College, B.Sc., M.Sc, Ph.D, Flight engineer and aviator.