sandialabs / WecOptTool

WEC Design Optimization Toolbox
https://sandialabs.github.io/WecOptTool/
GNU General Public License v3.0
12 stars 21 forks source link

Non-linear PTO losses #176

Closed cmichelenstrofer closed 1 year ago

cmichelenstrofer commented 1 year ago

Moving discussion from #173 here.

The description of the electric power as

P_e = P_m \cdot \eta (\tau, \dot{\theta}) = P_m \cdot (1-\beta(\tau, \dot{\theta}))

where $\eta$ is the efficiency, which is dependent on motor torque, $\tau$, and shaft speed, $\dot{\theta}$, cannot correctly account for cases in the (torque-velocity) axes (i.e., where $\tau=0$ and/or $\dot{\theta}=0$). The loss factor is $\beta$.

\eta = 1-\beta

Instead we should use

P_e = P_m + P_{loss}

where $P_{loss}$ is a user-supplied function of torque and shaft (rotational) velocity. Note that

\eta = \frac{P_m + P_{loss}}{P_m} \textrm{ for } P_m \neq 0

For simple (low velocity) cases a $I^2R$ loss model should work:

P_{loss} = (\tau/k_T)^2 R_w

where $\tau$, $k_\tau$, and $R_w$ are the input torque, the motor's torque constant, and the motor's winding resistance, respectively. Note that torque is (mostly) linearly proportional to current.

For more complex cases, multiple mechanisms contribute to the electric power loss. On possible approach is determining this function for your motor and fitting a parametric function to it, such as a polynomial. This would allow for it to be differentiable and usable in WecOptTool.

Another approach that might be viable is a piecewise function (apparently autograd supports this: https://github.com/HIPS/autograd/issues/36)

P_{loss} = 
\begin{cases}
(\eta - 1)P_m, & P_m \neq 0 \\
(\tau / k_\tau)^2 R_w, & P_m = 0
\end{cases}
cmichelenstrofer commented 1 year ago

@ryancoe changes look good! Why "(mostly)" non-linear?

dtgaebe commented 1 year ago

An approach for the suggested polynomial fitting is described in Mahmoudi2017. Assume you have a motor efficiency $\eta^{mtr} (\tau, \dot{\theta})$, thus

P_m^{mtr}  = P_e^{mtr}  \cdot \eta^{mtr} (\tau, \dot{\theta}).

With the current implementation $P_e = Pm + P{loss}$, we can convert the motor efficiency into an equivalent loss map

P_{loss}^{mtr} = P_e^{mtr}  - P_m^{mtr}  = \frac{1}{\eta^{mtr}}P_m^{mtr}  - P_m^{mtr}  = P_m^{mtr}  \left( \frac{1-\eta^{mtr}}{\eta^{mtr}} \right)

Now, Mahmoudi2017 suggest fitting the motor losses with physics based polynomial of $\tau$ and $\dot{\theta}$. The parametric function $P_{loss}^{mtr,fit}(\tau, \dot{\theta})$ is very likely non-zero at the axes, thus extrapolates copper losses (such as $I^2R$) towards the axes, when $P_m \rightarrow 0^+$.

If we now assume symmetric power loss for generating and motor operation we can approximate the loss map over all quadrants

P_{loss} = P_{loss}^{mtr,fit}(|\tau|, |\dot{\theta}|).