apply¶
- StartLimitCurrent.apply() None | float | int
It computes the
pwmto apply to themotorin order to limit its absorbed electric current to be lower or equal tolimit_electric_current, until theencoder’stargetrotating object’sangular_positionequals thetarget_angular_position.Returns¶
floatorintorNonePWM value to apply to the
motorin order to limit its absorbed electric current to be lower or equal tolimit_electric_current.
Notes
It checks the applicability condition, defined as:
\[\theta \le \theta_t\]where:
\(\theta\) is the
encoder’stargetangular_position,\(\theta_t\) is the
target_angular_position.
If the applicability condition is not met, then it returns
None, otherwise it computes thepwmas:\[D \left( \dot{\theta} \right) = \frac{1}{2} \, \left( \frac{\dot{\theta}}{\dot{\theta}_0} + \frac{i_{lim}}{i_{max}} + \sqrt{ \left( \frac{\dot{\theta}}{\dot{\theta}_0} \right)^2 + \left( \frac{i_{lim}}{i_{max}} \right)^2 + 2 \frac{\dot{\theta}}{\dot{\theta}_0} \frac{i_{lim} - 2 i_0}{i_{max}} } \right)\]where:
\(\dot{\theta}\) is the
tachometer’starget’s angular speed,\(\dot{\theta}_0\) is the
motorno load angular speed (DCMotor.no_load_speed),\(i_{lim}\) is the
limit_electric_currentparameter,\(i_{max}\) is the
motormaximum electric current (DCMotor.maximum_electric_current),\(i_0\) is the
motorno load electric current (DCMotor.no_load_electric_current).