1. OpenSourceRoboticsFoundation
  2. Simulation
  3. gazebo
  4. Issues
Issue #780 new

Provide torque-speed curve

Jesper Smith
created an issue

Real actuators have maximum torque and speed values that are independent(for example, electric motors have a linear relation)

It would be nice if a simple torque-speed curve can be given as an actuator limit instead of a maximum force and maximum velocity.

Comments (12)

  1. Brian Axelrod

    I agree, that this would be very useful. I've had to write gazebo plugins to do exactly this in the past.

    John Hsu I haven't spent too much time looking at the gazebo source, what would be involved in implementing this properly in gazebo itself?

  2. Brian Axelrod

    Is there documentation that explains what happens every gazebo update?

    On JointUpdate would I simply be able to set max force every single update cycle depending on speed? this->SetParam(dParamFMax, _value)

  3. Steven Peters

    I don't think there is documentation about the gazebo update process. I looked at World::Update, which calls Model::Update on every model. Model::Update calls Joint::Update, which currently just triggers the JointUpdate event and returns.

    Regarding your second question, that looks like it would work for ODE, though we may have to implement something different for each physics engine.

  4. John Hsu

    Jesper Smith I guess we can start by looking at the curves specified in the BDI private file repo for reference. Do you have any specific preference on which joint might be more interesting or important to model first?

  5. Jackie K

    I'm working on a proof-of-concept plugin for this right now in branch actuator_plugin, in plugins/ActuatorPlugin.

    The actuator plugin is a model plugin enforces a maximum torque based on the current velocity of the "actuated" joint. It sets up a callback on the WorldUpdateBegin event. In this callback, a maximum torque value is calculated from the torque-speed model, which is configurable by the user. The maximum torque value is enforced if the joint torque exceeds this value. I don't actually use Joint::SetMaxForce because it's buggy and doesn't work uniformly for each physics engine.

    I also set up a data collection example in examples/stand_alone/actuator/main.cc. It spawns two models that are identical except one has an actuated joint and the other has a passive joint. Joint::SetForce is used to enforce a constant force value on each joint for a fixed number of timesteps.

    Here are some plots. The maximum torque value for the actuator was set to 2, the maximum velocity was set to 20, and the power was set to 10 (arbitrarily chosen values that worked well together). The torque speed curve is calculated from torque = power/velocity.

    actuator_pos_time.png actuator_vel_time.png actuator_torque_speed_passive.png actuator_torque_speed_actuated.png

    Note that in the torque/velocity curve for the actuated joint, the initial flat part of the curve is 2--I was lazy with my joint axes, sorry folks. The plugin doesn't actually enforce a maximum velocity right now, since Joint::SetVelocity has some weird behavior. Feedback on that is welcome...

    John Hsu, Nathan Koenig: I'd like to pull request this work once it's finished, which Gazebo should I target? Steven Peters suggested I pull request it into 4.1, since it's a DRCSim milestone, and make a design document for integrating an Actuator class into the physics library, perhaps for Gazebo 6. Using a plugin creates a lot of limitations for this concept, but I thought it would be good practice to prototype modularly and a plugin seemed convenient for that.

  6. Log in to comment