20 #ifndef _se3_motor_model_hpp_ 21 #define _se3_motor_model_hpp_ 24 #include "pinocchio/macros.hpp" 25 #include "pinocchio/actuators/actuator-model.hpp" 123 template<
typename Scalar_>
127 typedef Scalar_ Scalar_t;
128 typedef typename Eigen::Matrix<Scalar_, 13,1 > Parameters_t;
129 typedef typename Eigen::Matrix<Scalar_, 3,1> Observations_t;
130 typedef typename Eigen::Matrix<Scalar_, 6,1> S_t;
131 typedef typename Eigen::Matrix<Scalar_, 2,1> X_t;
132 typedef typename Eigen::Matrix<Scalar_, 2,1> dX_t;
133 typedef typename Eigen::Matrix<Scalar_, 1,1> U_t;
135 enum InternalParameters
145 P_MAX_PERM_WINDING_T,
146 P_THERM_TIME_CST_WINDING
149 const Observations_t &
h()
const {
return h_;}
152 const Parameters_t &
c()
const {
return c_;}
155 const S_t &
S()
const {
return S_;}
221 return sqrt(1/(1-exp(-aDuration/
c_[P_THERM_TIME_CST_WINDING])));
229 return aCurrant/
c_[P_NOMINAL_CURRENT]*sqrt((
c_[P_MAX_PERM_WINDING_T]- 25)/(
c_[P_MAX_PERM_WINDING_T] - TS) *
230 (
c_[P_THONE_RESISTOR]/(
c_[P_THONE_RESISTOR] +
c_[P_THTWO_RESISTOR])));
238 return c_[P_THERM_TIME_CST_WINDING] * log(aK*aK/(aK*aK-1.0));
246 return aK *
c_[P_NOMINAL_CURRENT]*sqrt((
c_[P_MAX_PERM_WINDING_T] - TS)/(
c_[P_MAX_PERM_WINDING_T]- 25) *
247 (
c_[P_THONE_RESISTOR] +
c_[P_THTWO_RESISTOR])/(
c_[P_THONE_RESISTOR]));
250 Observations_t &
h() {
return h_;}
257 c_[0] =
c_[P_TORQUE_CST] /(
c_[P_ROTOR_INERTIA] *
c_[P_ROTOR_RESISTOR]);
260 c_[1] = -
c_[P_TORQUE_CST]*
c_[P_BACK_EMF] /(
c_[P_ROTOR_INERTIA] *
c_[P_ROTOR_RESISTOR])
261 -
c_[P_SPEED_TORQUE_GRD]/
c_[P_ROTOR_INERTIA];
263 c_[2] = -1/
c_[P_ROTOR_INERTIA];
283 template<
typename Scalar_>
287 typedef Eigen::Matrix<Scalar_,3,1,0> Vector3Scalar;
292 void calc(
typename ActuatorDCMotorData<Scalar_>::dX_t & dstate,
293 typename ActuatorDCMotorData<Scalar_>::X_t & state,
294 typename ActuatorDCMotorData<Scalar_>::U_t & control,
299 dstate[0] = state[1];
300 dstate[1] = data.
c()[0] * control[0] + data.
c()[1] * state[0] +
305 data.
h()[0] = control[0] /data.
c()[P_ROTOR_RESISTOR]
306 - data.
c()[P_BACK_EMF] *state[1]/data.
c()[P_ROTOR_RESISTOR];
308 data.
h()[1] = data.
c()[P_TORQUE_CST] *data.
h()[0];
310 data.
h()[2] = data.
c()[P_BACK_EMF] * state[1];
316 aForce.
linear(Vector3Scalar::Zero(3,1));
317 aForce.
angular(Vector3Scalar(0.0,0.0,data.
h()[1]));
330 template <
typename Scalar_>
336 template <
typename Scalar_>
void thermTimeCstWinding(Scalar_ c)
Therm. time constant winding units: seconds (s)
void resistorOne(Scalar_ c)
Gearhead thermal resistance at ambient temperature units: K/W.
Scalar_ getMaxPermissibleOverloadForONTime(Scalar_ aDuration)
Returns the maximum overload possible for a given duration. Implements .
const Parameters_t & c() const
Return parameters.
Concreate Class representing a force.
void backEMF(Scalar_ c)
Terminal Inductance (Henry)
void rotorInertia(Scalar_ c)
Rotor inertia (kg/m2) - .
const Vector6 & toVector() const
Return the force.
void updateParameters()
Update the first three parameters of the actuators:
ConstAngular_t angular() const
Return the angular part of the force vector.
void rotorResistor(Scalar_ c)
Rotor resistor (Ohm) - .
void torqueConst(Scalar_ c)
Torque constant (Nm/A) - .
Parameters_t c_
Vector parameters.
Scalar_ getMaxCurrentForK(Scalar_ aK)
Returns the maximum current at a given overload factor . Implements .
Template for handling data related to a second order linear DC motor model.
void resistorTA(Scalar_ c)
Winding resistance at ambient temperature units: Ohms.
Template which implements a second order linear DC motor model.
void maxPermissibleWindingTemp(Scalar_ c)
Max. permissible winding temperature catalog value units: C.
void resistorTwo(Scalar_ c)
Winding thermal resistance at ambient temperature units: K/W.
Observations_t h_
Observation variables.
Scalar_ getMaxONTimeForK(Scalar_ aK)
Returns the maximum ON time at a given overload factor K Implements .
void speedTorqueGrad(Scalar_ c)
Speed torque gradient (rads^-1/Nm) .
ConstLinear_t linear() const
Return the linear part of the force vector.
const S_t & S() const
Returns selection matrix.
Scalar_ getOverloadForCurrent(Scalar_ aCurrent, Scalar_ TS)
Returns the overload for a given motor current and the current stator temperature ( ) Implements ...
const Observations_t & h() const
Return observation vector.