Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible bug in DC motor update function when handling the load torque #12

Open
pedrofza opened this issue Jul 24, 2024 · 0 comments
Open

Comments

@pedrofza
Copy link

pedrofza commented Jul 24, 2024

I believe that the DC motor GazeboRosMotor::UpdateChild method is passing the actual_load_torque parameter of GazeboRosMotor::motorModelUpdate` with the wrong sign: https://github.com/nilseuropa/gazebo_ros_motors/blob/2fd0f319c43a2a58ff35f8e440f05093e62e2645/src/gazebo_ros_dc_motor.cpp#L371C71-L371C82

From what I could tell, the calculations in motorModelUpdate exactly match the ODE solution presented in https://github.com/nilseuropa/gazebo_ros_motors/blob/2fd0f319c43a2a58ff35f8e440f05093e62e2645/doc/dc_motor_de.pdf. The ODE assumes that the load torque opposes the torque produced by the motor, for the purposes of the equation "\omega'[t] = (Km i[t] - T - d \omega[t]) / J". Note that "Km i[t]" and "T" have opposing signs. The code doesn't seem to reflect that, as the equivalent of this->link_->RelativeTorque().Z() is passed as an argument, and the sign is never flipped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant