20 #ifndef _se3_temp_non_linear_motor_model_hpp_ 21 #define _se3_temp_non_linear_motor_model_hpp_ 24 #include "pinocchio/macros.hpp" 25 #include "pinocchio/actuators/actuator-model.hpp" 141 template<
typename Scalar_>
145 typedef Scalar_ Scalar_t;
146 typedef typename Eigen::Matrix<Scalar_, 13,1 > Parameters_t;
147 typedef typename Eigen::Matrix<Scalar_, 3,1> Observations_t;
148 typedef typename Eigen::Matrix<Scalar_, 6,1> S_t;
149 typedef typename Eigen::Matrix<Scalar_, 2,1> X_t;
150 typedef typename Eigen::Matrix<Scalar_, 2,1> dX_t;
151 typedef typename Eigen::Matrix<Scalar_, 1,1> U_t;
153 enum InternalParameters
162 P_MAX_PERM_WINDING_T,
163 P_THERM_TIME_CST_WINDING,
167 const Observations_t &
h()
const {
return h_;}
170 const Parameters_t &
c()
const {
return c_;}
173 const S_t &
S()
const {
return S_;}
241 return sqrt(1/(1-exp(-aDuration/
c_[P_THERM_TIME_CST_WINDING])));
249 return aCurrent/
c_[P_NOMINAL_CURRENT]*sqrt((
c_[P_MAX_PERM_WINDING_T]-
c_[P_AMBIENT_TEMP)/(
c_[P_MAX_PERM_WINDING_T] - TS) *
250 (
c_[P_THONE_RESISTOR]/(
c_[P_THONE_RESISTOR] +
c_[P_THTWO_RESISTOR])));
258 return c_[P_THERM_TIME_CST_WINDING] * log(aK*aK/(aK*aK-1.0));
266 return aK *
c_[P_NOMINAL_CURRENT]*sqrt((
c_[P_MAX_PERM_WINDING_T] - TS)/(
c_[P_MAX_PERM_WINDING_T]-
c_[P_AMBIENT_TEMP]) *
267 (
c_[P_THONE_RESISTOR] +
c_[P_THTWO_RESISTOR])/(
c_[P_THONE_RESISTOR]));
270 Observations_t &
h() {
return h_;}
277 c_[0] =
c_[P_TORQUE_CST];
280 c_[1] =
c_[P_ROTOR_INERTIA] *
c_[P_TA_RESISTOR])*(1+
c_[P_AMBIENT_TEMP] * alpha_cu);
286 c_[3] =
c_[P_BACK_EMF] +
c_[P_SPEED_TORQUE_GRD]*
c_[P_TA_RESISTOR] (1+alpha_cu_ *
c_[P_AMBIENT_TEMP]);
289 c_[4] = -c_[P_SPEED_TORQUE_GRD] * c_[P_TA_RESISTOR] *
alpha_cu_;
292 c_[5] = -1/c_[P_ROTOR_INERTIA];
295 c_[6] = c_[P_THONE_RESISTOR] + c_[P_THTWO_RESISTOR];
298 c_[7] = -c_[P_BACK_EMF];
301 c_[8] = c_[P_TA_RESISTOR] - alpha_cu_ * c_[P_AMBIENT_TEMP] * c_[P_TA_RESISTOR];
304 c_[9] = alpha_cu_ *c_[P_TA_RESISTOR];
307 c_[10] = alpha_cu_ * (c_[P_THONE_RESISTOR] + c_[P_THTWO_RESISTOR]);
331 template<
typename Scalar_>
335 typedef Eigen::Matrix<Scalar_,3,1,0> Vector3Scalar;
340 void calc(
typename ActuatorDCTempNonLinearMotorData<Scalar_>::dX_t & dstate,
341 typename ActuatorDCTempNonLinearMotorData<Scalar_>::X_t & state,
342 typename ActuatorDCTempNonLinearMotorData<Scalar_>::U_t & control,
347 dstate[0] = state[1];
348 dstate[1] = data.
c()[0]/(data.
c()[1] + data.
c()[2]*state[2]) * control[0] +
349 state[1]*(data.
c()[3]+data.
c()[4]*state[2])/(data.
c()[1] + data.
c()[2]*state[2])
355 data.
h()[0] = control[0] /data.
c()[P_ROTOR_RESISTOR]
356 - data.
c()[P_BACK_EMF] *state[1]/data.
c()[P_ROTOR_RESISTOR];
358 data.
h()[1] = data.
c()[P_TORQUE_CST] *data.
h()[0];
360 data.
h()[2] = data.
c()[P_BACK_EMF] * state[1];
366 aForce.
linear(Vector3Scalar::Zero(3,1));
367 aForce.
angular(Vector3Scalar(0.0,0.0,data.
h()[1]));
380 template <
typename Scalar_>
386 template <
typename Scalar_>
const Observations_t & h() const
Return observation vector.
const Parameters_t & c() const
Return parameters.
void updateParameters()
Update the first three parameters of the actuators:
Template which implements a second order linear DC motor model.
Observations_t h_
Observation variables.
Scalar_ getMaxPermissibleOverloadForONTime(Scalar_ aDuration)
Returns the maximum overload possible for a given duration. Implements .
Concreate Class representing a force.
void speedTorqueGrad(Scalar_ c)
Speed torque gradient (rads^-1/Nm) .
Scalar_ getMaxONTimeForK(Scalar_ aK)
Returns the maximum ON time at a given overload factor K Implements .
const Vector6 & toVector() const
Return the force.
void maxPermissibleWindingTemp(Scalar_ c)
Max. permissible winding temperature catalog value units: C.
void backEMF(Scalar_ c)
Terminal Inductance (Henry)
void thermAmbient(Scalar_ c)
Ambient temperature for the motor characteristics. Typically .
ConstAngular_t angular() const
Return the angular part of the force vector.
void torqueConst(Scalar_ c)
Torque constant (Nm/A) - .
void resistorOne(Scalar_ c)
Gearhead thermal resistance at ambient temperature units: K/W.
Parameters_t c_
Vector parameters.
const S_t & S() const
Returns selection matrix.
void thermTimeCstWinding(Scalar_ c)
Therm. time constant winding units: seconds (s)
void rotorInertia(Scalar_ c)
Rotor inertia (kg/m2) - .
double alpha_cu_
Copper resistance.
void resistorTwo(Scalar_ c)
Winding thermal resistance at ambient temperature units: K/W.
void resistorTA(Scalar_ c)
Winding resistance at ambient temperature units: Ohms.
ConstLinear_t linear() const
Return the linear part of the force vector.
Scalar_ getOverloadForCurrent(Scalar_ aCurrent, Scalar_ TS)
Returns the overload for a given motor current and the current stator temperature ( ) Implements ...
Template for handling data related to a second order linear DC motor model.
Scalar_ getMaxCurrentForK(Scalar_ aK)
Returns the maximum current at a given overload factor . Implements .