• Non ci sono risultati.

5.2 FOC strategy for an IPM synchronous motor

5.2.4 Torque control loop and MTPA region

130

Now it is possible to optimize the system and to compute the angle which guarantees the maximum torque for different amplitude values of the stator current. A simple code is implemented in MATLAB for computing the direct and quadrature contributions in correspondence of the torque request:

%% Motor parameters

lambdaPM=0.044; %Vs, PM magnetic flux Ld=0.000086; %H, direct axis inductance Lq=0.000215; %H, quadrature axis inductance pp=5; %# pole pairs

Tmax=237; %Nm, maximum torque

%% MTPA

T=[0:1.5:Tmax];

beta=[0:(pi/2/3000):pi/2]; %angle from positive q-axis to negative d-axis for i=1:size(T,2)

for j=2:size(beta,2)

a=3/2*pp*(Lq-Ld)*sin(2*beta(j))/2;

b=3/2*pp*lambdaPM*cos(beta(j));

c=-T(i);

delta=b^2-4*a*c;

I1(j-1)=(-b+sqrt(b^2-4*a*c))/(2*a); %positive value (used)

I2(j-1)=(-b-sqrt(b^2-4*a*c))/(2*a); %negative value (neglected) end

[a b]=min(I1);

Imtpa(i)=a;

theta_mtpa(i)=beta(b(1));

end

%% OUTPUT LUTs

LUT_id=(-Imtpa.*sin(theta_mtpa))';

LUT_iq=(Imtpa.*cos(theta_mtpa))';

In the upper part, the motor parameters are set. Then, for each torque value in the range [0,π‘‡π‘šπ‘Žπ‘₯], with a delta equal to 1.5 Nm, the amplitude of the stator current is computed in a for loop, where the MTPA angle varies. A 90Β° rotation is considered for 𝛽 (from the positive part of q-axis towards the negative part of d-axis), with an accurate resolution to obtain an efficient algorithm. An array of possible magnitude I is obtained by inverting the previous equation for fixed torque and angle:

3

2𝑝𝑝 (πΏπ‘žβˆ’ 𝐿𝑑) sin(2𝛽)

2 𝐼2 + 3

2𝑝𝑝 πœ†π‘ƒπ‘€ cos(𝛽) 𝐼 βˆ’ π‘‡π‘’π‘š = 0

Because it is a quadratic equation, two solutions are obtained: one of them is always negative, so it cannot be accepted for a magnitude quantity. In the resulting vector, corresponding to a specific torque value, the minimum is chosen, and it is assigned to a different array. Finally, using the angle 𝛽 corresponding to that minimum magnitude, the direct and quadrature contributions are evaluated. Then, for the successive torque request

132 the loop is repeated and another array of possible magnitude I is established: through the minimization function, the optimal stator current is obtained and the new MTPA angle is used for computing 𝑖𝑑 and π‘–π‘ž. In this way the look-up tables can be generated for both direct and quadrature stator currents. The number of elements in each array is 159, due to the maximum torque and the delta. The 𝑖𝑑 sign should always be negative, while π‘–π‘ž depends on the torque sign. In fact, in this project also the negative request π‘‡βˆ— is analysed and managed, realizing a simple reverse gear system (with a negative speed). Moreover, a negative torque is present in regenerative braking conditions, as it will be shown in the real-time results section. It is worth noting that the MTPA angle is different for each current amplitude: this means that the resulting curve in dq reference frame is not linear (fig. 5.17). In the constant torque region, for any possible request a different couple of values 𝑖𝑑, π‘–π‘ž is obtained.

Once realized the LUTs, in the real-time interface the mechanism for reading them is implemented: the arrays are then passed to the FPGA VI, where an interpolation strategy is used for evaluating the direct and quadrature reference currents from the torque request.

The interpolation is fundamental, because due to hardware limitation, the dimension of the two arrays is restricted (159 elements for each of them) and a high delta (1.5 Nm) – and consequently low resolution – is used in the MATLAB code between two successive torque values. The algorithm is the following: the torque request magnitude is firstly compared with the minimum and maximum – reduced by the same delta used in the code – allowable values;

then, a multiplication for the reciprocal of the torque is executed and the so-called π‘₯𝑖𝑛 is obtained. This strategy allows simplifying the system, because the array index is directly extracted: from the range [0,237] Nm the values are passed to the range [0,158]. The indexes for 𝑖𝑑 and π‘–π‘ž are computed by using a floor operator to evaluate the next lowest integer (π‘₯1) and an increment block for the next highest integer (π‘₯2). The upper (𝑦2) and lower (𝑦1) values – with respect to the reference ones – of both direct and quadrature currents are pulled out from the arrays. The interpolation is realized through a simple linear approach:

π‘¦π‘œπ‘’π‘‘ = 𝑦1+(𝑦2βˆ’ 𝑦1)

(π‘₯2βˆ’ π‘₯1) (π‘₯π‘–π‘›βˆ’ π‘₯1) = 𝑦1+ (𝑦2βˆ’ 𝑦1) (π‘₯π‘–π‘›βˆ’ π‘₯1)

In fact, thanks to the multiplication of the torque for the reciprocal of the delta, the value π‘₯2βˆ’ π‘₯1 is constantly equal to one; so, the computation of the output reference π‘–π‘‘βˆ— and π‘–π‘žβˆ— is facilitated. To manage also the negative request, a selector is used for switching from π‘–π‘žβˆ— to

βˆ’π‘–π‘žβˆ—. A negative torque corresponds to a negative quadrature contribution, while the direct value remains unchanged and negative. The complete MTPA block is shown in figure 5.18.

Figure 5.18: MTPA interpolation block diagram.

134 The previous analysis is valid just for the constant torque region. In flux-weakening condition (constant power) the MTPA block stops working, because the PI regulator is responsible for establishing the value π‘–π‘‘βˆ—. In other words, the last MTPA d-axis current is used as initial condition for computing the value in correspondence to the request – arrived directly by the user or filtered by the 𝐼𝐷𝐢 regulator. The reference quadrature contribution is obtained by inverting the torque equation, knowing π‘–π‘‘βˆ— and π‘‡βˆ—:

π‘–π‘žβˆ— = π‘‡βˆ—

32 𝑝𝑝 [πœ†π‘ƒπ‘€ + (πΏπ‘‘βˆ’ πΏπ‘ž) π‘–π‘‘βˆ—]

Then, saturation blocks are used in order to give priority to the direct axis and to limit the quadrature value, depending on the maximum amplitude of the phase current and on the actual direct reference π‘–π‘‘βˆ—. The working principle of the flux-weakening PI regulator will be analysed in successive sections.

By implementing this mechanism in real-time, many overshoots, ripples and hazardous peaks are detected. The step variation of the user request, in fact, is responsible for deteriorating the dynamic performance of the control system. For counterbalancing this problem, an improvement is inserted in the chain: the torque and speed references are converted into ramp signals through dedicated blocks. Consequently, the velocity of the response is reduced, but the stability is increased. For realizing the mechanism, the impulsive demand is constantly compared with the output value of the block at the previous cycle – a feedback node is used for this purpose. If the reference step is positive, the feedback quantity is constantly increased by the chosen slope multiplied for the discrete time interval of the control loop – control and plant loops have different integration steps in order to reflect their different dynamic behaviours. In case of a reduction of the torque (or speed) request, the output value of the block is decreased by again the multiplication of the slope for the controller discrete integration step. Once the block output has reached the reference value, the selectors are managed to maintain a fixed value, until a different request arrives. For torque quantities, in order to obtain accurate results, 30-bit fixed-point words are used, with 11 bits for the integer part – to completely cover, with an adequate resolution, the maximum range (π‘‡π‘šπ‘Žπ‘₯ = 237 Nm). Furthermore, in the final configuration of the control system the user request, if necessary, is filtered and limited by the PI that manages the actual DC of simulated battery pack and inverter, depending on the maximum and minimum limits – which arrive through the CAN bus. Because the regulator is at the beginning of the chain, for the other blocks – i.e. the regulators, the transformations, the MTPA block – the working principle remains unchanged.

Figure 5.19: SubVI for converting the step torque request into a ramp reference signal π‘‡βˆ—.