motors¶
-
class AbstractMotorBase¶
Subclassed by jiminy::SimpleMotor
Public Functions
-
inline virtual GenericConfig getDefaultMotorOptions()¶
Dictionary gathering the configuration options shared between motors.
-
explicit AbstractMotorBase(const std::string &name)¶
- Parameters:
name – [in] Name of the motor.
-
virtual ~AbstractMotorBase()¶
-
virtual void refreshProxies()¶
Refresh the proxies.
Remark
This method is not intended to be called manually. The Robot to which the motor is added is taking care of it when its own
refresh
method is called.
-
virtual void resetAll()¶
Reset the internal state of the motors.
This method resets the internal state of the motor.
Remark
This method is not intended to be called manually. The Robot to which the motor is added is taking care of it when its own
reset
method is called.
-
const GenericConfig &getOptions() const noexcept¶
Configuration options of the motor.
-
std::tuple<double, double> get() const¶
Actual effort of the motor at the current time.
-
std::tuple<Eigen::Ref<const Eigen::VectorXd>, Eigen::Ref<const Eigen::VectorXd>> getAll() const¶
Actual effort of all the motors at the current time.
-
virtual void setOptions(const GenericConfig &motorOptions)¶
Set the configuration options of the motor.
- Parameters:
motorOptions – [in] Dictionary with the parameters of the motor.
-
void setOptionsAll(const GenericConfig &motorOptions)¶
Set the same configuration options for all motors of same type as current one.
- Parameters:
motorOptions – [in] Dictionary with the parameters used for any motor.
-
bool getIsAttached() const¶
Whether the motor has been attached to a robot.
-
bool getIsInitialized() const¶
Whether the motor has been initialized.
-
const std::string &getName() const¶
Name of the motor.
-
std::size_t getIndex() const¶
Index of the motor.
-
const std::string &getJointName() const¶
Name of the joint associated with the motor.
-
pinocchio::JointIndex getJointIndex() const¶
Index of the joint associated with the motor in the kinematic tree.
-
double getPositionLimitLower() const¶
Maximum position of the actuated joint translated on motor side.
-
double getPositionLimitUpper() const¶
Minimum position of the actuated joint translated on motor side.
-
double getVelocityLimit() const¶
Maximum velocity of the motor.
-
double getEffortLimit() const¶
Maximum effort of the motor.
-
double getArmature() const¶
Rotor inertia of the motor on joint side.
-
double getBacklash() const¶
Backlash of the transmission on joint side.
-
virtual void computeEffort(double t, const Eigen::VectorBlock<const Eigen::VectorXd> &q, double v, double a, double command) = 0¶
Request the motor to update its actual effort based of the input data.
It assumes that the internal state of the robot is consistent with the input arguments.
- Parameters:
t – [in] Current time.
q – [in] Current configuration of the motor.
v – [in] Current velocity of the motor.
a – [in] Current acceleration of the motor.
command – [in] Current command effort of the motor.
-
void computeEffortAll(double t, const Eigen::VectorXd &q, const Eigen::VectorXd &v, const Eigen::VectorXd &a, const Eigen::VectorXd &command)¶
Request every motors to update their actual effort based of the input data.
It assumes that the internal state of the robot is consistent with the input arguments.
Remark
This method is not intended to be called manually. The Robot to which the motor is added is taking care of it while updating the state of the motors.
- Parameters:
t – [in] Current time.
q – [in] Current configuration vector of the robot.
v – [in] Current velocity vector of the robot.
a – [in] Current acceleration vector of the robot.
command – [in] Current command effort vector of the robot.
Public Members
-
std::unique_ptr<const AbstractMotorOptions> baseMotorOptions_ = {nullptr}¶
Structure with the parameters of the motor.
-
struct AbstractMotorOptions¶
Subclassed by jiminy::SimpleMotor::SimpleMotorOptions
Public Functions
-
inline AbstractMotorOptions(const GenericConfig &options)¶
Public Members
-
const double mechanicalReduction¶
Mechanical reduction ratio of transmission (joint/motor), usually >= 1.0.
-
const bool velocityLimitFromUrdf¶
-
const double velocityLimit¶
-
const bool effortLimitFromUrdf¶
-
const double effortLimit¶
-
const bool enableArmature¶
-
const double armature¶
-
const bool enableBacklash¶
-
const double backlash¶
-
inline AbstractMotorOptions(const GenericConfig &options)¶
-
inline virtual GenericConfig getDefaultMotorOptions()¶
-
class SimpleMotor : public jiminy::AbstractMotorBase¶
Public Functions
-
inline virtual GenericConfig getDefaultMotorOptions() override¶
Dictionary gathering the configuration options shared between motors.
-
explicit SimpleMotor(const std::string &name)¶
-
virtual ~SimpleMotor() = default¶
-
void initialize(const std::string &jointName)¶
-
virtual void setOptions(const GenericConfig &motorOptions) override¶
Set the configuration options of the motor.
- Parameters:
motorOptions – [in] Dictionary with the parameters of the motor.
-
struct SimpleMotorOptions : public jiminy::AbstractMotorBase::AbstractMotorOptions¶
Simple motor that does not required specifying advanced motor constant (phase inductance, back-EMF…), nor hardware properties such as battery voltage.
The motor torque is applied instantaneously, but may be saturated to make into account the maximum torque at zero velocity and the maximum velocity at zero load. A simple linear model is used for the maximum velocity. For reference: https://things-in-motion.blogspot.com/2019/05/understanding-bldc-pmsm-electric-motors.html
See also
For details about the modelling of PMSM motors (ie brushless motors), see: https://github.com/matthieuvigne/nemo_bldc/blob/1c9073114a70d762b8d13774e7da984afd48bd32/src/nemo_bldc/doc/BrushlessMotorPhysics.pdf
Public Functions
-
inline SimpleMotorOptions(const GenericConfig &options)¶
Public Members
-
const bool enableVelocityLimit¶
Wether velocity limit is enabled.
-
const double velocityEffortInvSlope¶
Inverse constant decrease rate of the maximum torque wrt velocity when approaching the maximum velocity. The maximum torque is equal to zero at maximum velocity.
-
const bool enableEffortLimit¶
Wether effort limit is enabled.
-
const bool enableFriction¶
Wether joint friction is enabled.
-
const double frictionViscousPositive¶
Viscous coefficient of the joint friction for positive velocity.
- Pre:
Must be negative.
-
const double frictionViscousNegative¶
Viscous coefficient of the joint friction for negative velocity.
- Pre:
Must be negative.
-
const double frictionDryPositive¶
Dry coefficient of the joint friction for positive velocity, which corresponds to the positive dry friction at saturation.
- Pre:
Must be negative.
-
const double frictionDryNegative¶
Dry coefficient of the joint friction for negative velocity, which corresponds to the negative dry friction at saturation.
- Pre:
Must be negative.
-
const double frictionDrySlope¶
Slope of the Tanh of the joint velocity that saturates the dry friction.
- Pre:
Must be negative.
-
inline SimpleMotorOptions(const GenericConfig &options)¶
-
inline virtual GenericConfig getDefaultMotorOptions() override¶