# FEM-Parameterized Rotary Actuator

Model rotary actuator defined in terms of magnetic flux

## Library

Rotational Actuators

## Description

The FEM-Parameterized Rotary Actuator block implements a model of a rotary actuator defined in terms of magnetic flux. Use this block to model custom rotary actuators and motors where magnetic flux depends on both rotor angle and current. You parameterize the block using data from a third-party Finite Element Magnetic (FEM) package.

The block has two options for the electrical equation. The first, ```Define in terms of dPhi(i,theta)/dtheta and dPhi(i,theta)/di```, defines the current in terms of partial derivatives of the magnetic flux (Φ) with respect to rotor angle (θ) and current (i), the equations for which are:

`$\frac{di}{dt}=\left(v-iR-\frac{\partial \Phi }{\partial \theta }\frac{d\theta }{dt}\right)/\frac{\partial \Phi }{\partial i}$`

The second option, `Define in terms of Phi(i,theta)`, defines the voltage across the component directly in terms of the flux, the equation for which is:

`$v=iR+\frac{d}{dt}\Phi \left(\theta ,i\right)$`

Numerically, defining the electrical equation in terms of flux partial derivatives is better because the back-emf is piecewise continuous. If using the flux directly, using a finer grid size for current and position will improve results, as will selecting cubic or spline interpolation.

In both cases, you have an option to either directly specify the torque as a function of current and rotor angle, by using the Torque matrix, T(i,theta) parameter, or have the block automatically calculate the torque matrix.

If entering the electromagnetic torque data directly, you can either use data supplied by the finite element magnetic package (which you used to determine the flux) or calculate the torque from the flux with following equation:

`$T=\underset{0}{\overset{i}{\int }}\frac{\partial \Phi \left(\theta ,i\right)}{\partial \theta }di$`

See the Finite Element Parameterized Solenoid example model and its initialization file `elec_fem_solenoid_ini.m` for an example of how to implement this type of integration in MATLAB®.

Alternatively, the block can automatically calculate the torque matrix from the flux information that you provide. To select this option, set the Calculate torque matrix? parameter to `Yes`. The torque matrix calculation occurs at model initialization based on current block flux linkage information. The torque is calculated by numerically integrating the rate of change of flux linkage with respect to angle over current, according to the preceding equation. If the Electrical model parameter is set to `Define in terms of Phi(i,theta)`, then the block must first estimate the Flux partial derivative wrt angle, Phi(i,theta)/dtheta parameter value from the flux linkage data. When doing this, the block uses the interpolation method specified by the Interpolation method parameter. Typically, the `Smooth` option is most accurate, but the `Linear` option is most robust.

You can define Φ and its partial derivatives for just positive, or positive and negative currents. If defining for just positive currents, then the block assumes that Φ(–i,x) = –Φ(i,x). Therefore, if the current vector is positive only:

• The first current value must be zero.

• The flux corresponding to zero current must be zero.

• The partial derivative of flux with respect to rotor angle must be zero for zero current.

To model a rotary motor with a repeated flux pattern, set the Flux dependence on displacement parameter to `Cyclic`. When selecting this option, the torque and flux (or torque and flux partial derivatives depending on the option chosen) must have identical first and last columns.

### Thermal Port

The block has an optional thermal port, hidden by default. To expose the thermal port, right-click the block in your model, and then from the context menu select Simscape > Block choices > Show thermal port. This action displays the thermal port H on the block icon, and adds the Temperature Dependence and Thermal Port tabs to the block dialog box.

Use the thermal port to simulate the effects of copper resistance losses that convert electrical power to heat. For more information on using thermal ports and on the Temperature Dependence and Thermal Port tab parameters, see Simulating Thermal Effects in Rotational and Translational Actuators.

## Basic Assumptions and Limitations

This block has the following limitations:

• It is imperative that you supply a consistent set of torque and flux data. There is no checking that the torque matrix is consistent with the flux data.

• When driving the FEM-Parameterized Rotary Actuator block via a series inductor, you may need to include a parallel conductance in the inductor component.

## Dialog Box and Parameters

### Magnetic Force Tab

Electrical model

Select one of the following parameterization options, based on the underlying electrical model:

• ```Define in terms of dPhi(i,theta)/dtheta and dPhi(i,theta)/di``` — Define the current through the block in terms of partial derivatives of the magnetic flux with respect to rotor angle and current. This is the default method.

• `Define in terms of Phi(i,theta)` — Define the voltage across the block terminals directly in terms of the flux.

Current vector, i

Specify a vector of monotonically increasing current values corresponding to your torque-flux data. If you specify positive currents only, the first element must be zero. The default value is ```[ 0 0.2 0.4 0.6 0.8 1 ]``` A.

Angle vector, theta

Specify a vector of monotonically increasing rotor angle values corresponding to your torque-flux data. The default value is ```[ 0 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 ]``` deg.

Flux partial derivative wrt current, dPhi(i,theta)/di

Specify a matrix of the flux partial derivatives with respect to current. This parameter is visible only if Electrical model is set to ```Define in terms of dPhi(i,theta)/dtheta and dPhi(i,theta)/di```. The default value, in Wb/A, is:

```[ 0.002 0.0024 0.0035 0.0052 0.0074 0.0096 0.0118 0.0135 0.0146 ... 0.015 0.0146 0.0135 0.0118 0.0096 0.0074 0.0052 0.0035 0.0024 0.002; 0.002 0.0024 0.0035 0.0052 0.0074 0.0096 0.0118 0.0135 0.0146 ... 0.015 0.0146 0.0135 0.0118 0.0096 0.0074 0.0052 0.0035 0.0024 0.002; 0.002 0.0024 0.0035 0.0052 0.0074 0.0096 0.0118 0.0135 0.0146 ... 0.015 0.0146 0.0135 0.0118 0.0096 0.0074 0.0052 0.0035 0.0024 0.002; 0.002 0.0024 0.0035 0.0052 0.0074 0.0096 0.0118 0.0135 0.0146 ... 0.015 0.0146 0.0135 0.0118 0.0096 0.0074 0.0052 0.0035 0.0024 0.002; 0.002 0.0024 0.0035 0.0052 0.0074 0.0096 0.0118 0.0135 0.0146 ... 0.015 0.0146 0.0135 0.0118 0.0096 0.0074 0.0052 0.0035 0.0024 0.002; 0.002 0.0024 0.0035 0.0052 0.0074 0.0096 0.0118 0.0135 0.0146 ... 0.015 0.0146 0.0135 0.0118 0.0096 0.0074 0.0052 0.0035 0.0024 0.002; ]```
Flux partial derivative wrt angle, dPhi(i,theta)/dtheta

Specify a matrix of the flux partial derivatives with respect to rotor angle. This parameter is visible only if Electrical model is set to ```Define in terms of dPhi(i,theta)/dtheta and dPhi(i,theta)/di```. The default value, in Wb/rad, is:

```[ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0; 0 9e-4 0.0017 0.0023 0.0026 0.0026 0.0023 0.0017 9e-4 ... 0 -9e-4 -0.0017 -0.0023 -0.0026 -0.0026 -0.0023 -0.0017 -9e-4 0; 0 0.0018 0.0033 0.0045 0.0051 0.0051 0.0045 0.0033 0.0018 ... 0 -0.0018 -0.0033 -0.0045 -0.0051 -0.0051 -0.0045 -0.0033 -0.0018 0; 0 0.0027 0.005 0.0068 0.0077 0.0077 0.0068 0.005 0.0027 ... 0 -0.0027 -0.005 -0.0068 -0.0077 -0.0077 -0.0068 -0.005 -0.0027 0; 0 0.0036 0.0067 0.009 0.0102 0.0102 0.009 0.0067 0.0036 ... 0 -0.0036 -0.0067 -0.009 -0.0102 -0.0102 -0.009 -0.0067 -0.0036 0; 0 0.0044 0.0084 0.0113 0.0128 0.0128 0.0113 0.0084 0.0044 ... 0 -0.0044 -0.0084 -0.0113 -0.0128 -0.0128 -0.0113 -0.0084 -0.0044 0 ]```

Specify a matrix of the total flux linkage, that is, flux times the number of turns. This parameter is visible only if Electrical model is set to `Define in terms of Phi(i,theta)`. The default value, in Wb, is:

```[ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0; 4e-4 4.8e-4 7e-4 0.00105 0.00147 0.00193 0.00235 0.0027 0.00292 ... 0.003 0.00292 0.0027 0.00235 0.00193 0.00147 0.00105 7e-4 4.8e-4 4e-4; 8e-4 9.6e-4 0.00141 0.0021 0.00295 0.00385 0.0047 0.00539 0.00584 ... 0.006 0.00584 0.00539 0.0047 0.00385 0.00295 0.0021 0.00141 9.6e-4 8e-4; 0.0012 0.00144 0.00211 0.00315 0.00442 0.00578 0.00705 0.00809 0.00876 ... 0.009 0.00876 0.00809 0.00705 0.00578 0.00442 0.00315 0.00211 0.00144 0.0012; 0.0016 0.00191 0.00282 0.0042 0.0059 0.0077 0.0094 0.01078 0.01169 ... 0.012 0.01169 0.01078 0.0094 0.0077 0.0059 0.0042 0.00282 0.00191 0.0016; 0.002 0.00239 0.00352 0.00525 0.00737 0.00963 0.01175 0.01348 0.01461 ... 0.015 0.01461 0.01348 0.01175 0.00963 0.00737 0.00525 0.00352 0.00239 0.002 ]```

Calculate torque matrix?

Specify the way of providing the electromagnetic torque data:

• `No — specify directly` — Enter the electromagnetic torque data directly, by using the Torque matrix, T(i,theta) parameter. This is the default option.

• Yes — The block calculates the torque from the flux linkage information, as a function of current and rotor angle.

Torque matrix, T(i,theta)

Specify a matrix of the electromagnetic torque applied to the rotor. This parameter is visible only if Calculate torque matrix? is set to `No — specify directly`. The default value, in mN*m, is:

```[ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0; 0 0.0889 0.1671 0.2252 0.2561 0.2561 0.2252 0.1671 0.0889 ... 0 -0.0889 -0.1671 -0.2252 -0.2561 -0.2561 -0.2252 -0.1671 -0.0889 0; 0 0.3557 0.6685 0.9007 1.0242 1.0242 0.9007 0.6685 0.3557 ... 0 -0.3557 -0.6685 -0.9007 -1.0242 -1.0242 -0.9007 -0.6685 -0.3557 0; 0 0.8003 1.5041 2.0265 2.3045 2.3045 2.0265 1.5041 0.8003 ... 0 -0.8003 -1.5041 -2.0265 -2.3045 -2.3045 -2.0265 -1.5041 -0.8003 0; 0 1.4228 2.674 3.6027 4.0968 4.0968 3.6027 2.674 1.4228 ... 0 -1.4228 -2.674 -3.6027 -4.0968 -4.0968 -3.6027 -2.674 -1.4228 0; 0 2.2231 4.1781 5.6292 6.4013 6.4013 5.6292 4.1781 2.2231 ... 0 -2.2231 -4.1781 -5.6292 -6.4013 -6.4013 -5.6292 -4.1781 -2.2231 0 ]```
Flux dependence on displacement

Specify the flux pattern:

• `Unique` — No flux pattern present. This is the default option.

• `Cyclic` — Select this option to model a rotary motor with a repeated flux pattern. The torque and flux (or torque and flux partial derivatives, depending on the Electrical model option chosen) must have identical first and last columns.

Interpolation method

Select one of the following interpolation methods for approximating the output value when the input value is between two consecutive grid points:

• `Linear` — Select this option to get the best performance.

• `Smooth` — Select this option to produce a continuous surface with continuous first-order derivatives.

For more information on interpolation algorithms, see the PS Lookup Table (2D) block reference page.

Extrapolation method

Select one of the following extrapolation methods for determining the output value when the input value is outside the range specified in the argument list:

• `Linear` — Select this option to produce a surface with continuous first-order derivatives in the extrapolation region and at the boundary with the interpolation region.

• `Nearest` — Select this option to produce an extrapolation that does not go above the highest point in the data or below the lowest point in the data.

For more information on extrapolation algorithms, see the PS Lookup Table (2D) block reference page.

This parameter is not available if you set the Flux dependence on displacement parameter to `Cyclic`.

Winding resistance

Total resistance of the electrical winding. The default value is `10` Ohm.

### Mechanical Tab

Damping

Rotary damping. The default value is `1e-4` N*m/(rad/s). The value can be zero.

Rotor inertia

Inertia of the rotor attached to mechanical translational port R. The default value is `5e-5` kg*m^2. The value can be zero.

Minimum rotor angle

The rotor angle at which the lower mechanical end stop is applied. The default value is `-Inf`.

Maximum rotor angle

The rotor angle at which the upper mechanical end stop is applied. The default value is `Inf`.

Initial rotor position

Position of the rotor at the start of the simulation. The default value is `0` deg.

Initial rotor velocity

Angular velocity of the rotor at the start of the simulation. The default value is `0` deg/s.

Contact stiffness

Contact stiffness between rotor and end stops. The default value is `1e8` N*m/rad.

Contact damping

Contact damping between rotor and end stops. The default value is `1e4` N*m/(rad/s).

## Ports

This block has the following ports:

`+`

Positive electrical conserving port

`-`

Negative electrical conserving port

`C`

Mechanical rotational conserving port connected to the actuator case

`R`

Mechanical rotational conserving port connected to the rotor