ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hello , think of your system(dc motors) as a lineer system which is not xdot = A(t)x + B(t)u y = C(t)x + D(t)u

x is your state vectors and u is your inputs. When you apply inputs( such as a step function) to your system, you can't get same output because of system dynamics, etc..

So you have to implement a PID controller( because it is the easiest one to implement) to follow your inputs. If you have 2 wheels actuated by dc motor, you have to apply pid controller for both of them. If third wheel is a castor wheel, you can't apply pid control for it because it doesn't have any actuator.

Jumping stuff occurs maybe because of your pid gains or damping ratio of the joints in gazebo, have you added SimpleTransmission to your joints in your xacro file such as shown below?

<transmission type="pr2_mechanism_model/SimpleTransmission" name="righwheeljoint">
            <actuator name="rightwheelmotor" />
            <joint name="rightWheelJoint" />
            <mechanicalReduction>1.0</mechanicalReduction>
            <motorTorqueConstant>1.32</motorTorqueConstant>
</transmission>

Here is a great tutorial about dc motor modeling and controlling for continuous time

modeling controlling

don't forget you apply your control algorithm in discrete time.

Hope it helps, good luck