Hi Julio.
Is it possible to input torque values in dCustomHinge joints ?
Or the only way is using dCustomHingeActuator ?
Thks
Moderators: Sascha Willems, walaber
if (m_options.m_option2 || m_options.m_option3) {
// the joint is motor
dFloat accel;
if (m_options.m_option3)
{
dFloat mass;
dFloat dummy;
NewtonBodyGetMass(m_body0, &mass, &dummy, &dummy, &dummy);
if (m_body1) {
dFloat mass2;
NewtonBodyGetMass(m_body1, &mass2, &dummy, &dummy, &dummy);
mass += mass2;
}
accel = m_motorTorque/mass;
}
else
{
accel = (m_motorSpeed - m_jointOmega) / timestep;
}
NewtonUserJointAddAngularRow(m_joint, 0.0f, &matrix0.m_front[0]);
NewtonUserJointSetRowAcceleration(m_joint, accel);
NewtonUserJointSetRowStiffness(m_joint, m_stiffness);
NewtonUserJointSetRowMinimumFriction(m_joint, -m_friction);
NewtonUserJointSetRowMaximumFriction(m_joint, m_friction);
} else {
void CommandTorque(float commandedTorque)
{
float commandedTorque= 10; // 10Nm
dCustomHingeActuator->SetAngularRate(infinity*Sign(desiredTorque))
dCustomHingeActuator->SetMaxTorque(desiredTorque)
}
I have implemented Field Oriented Control on a motor using a microcontroller. And from a hardware control standpoint Torque is actually the main input (in the form of current limiting). All the control laws are built by taking the current angle and angular velocity, etc and then commanding a torque. Alot of robot motors are have different "Modes", Torque Control, Angular Velocity Control, Position Control, etc.
CUSTOM_JOINTS_API dFloat GetFriction () const;
CUSTOM_JOINTS_API void SetFriction (dFloat frictionTorque);
CUSTOM_JOINTS_API dFloat GetJointOmega () const;
CUSTOM_JOINTS_API void EnableMotor(bool state, dFloat motorSpeed);
I have been following 4.0 and testing the sandbox. I plan on updating My Urho3D Bindings soon if I can. Exciting to see the solver updates.
Users browsing this forum: No registered users and 18 guests