public ChLinkMotorRotationTorque() { this.c_rz = false; SetupLinkMask(); m_func = new ChFunction_Const(0.0); }
// This can be used, at each time step, to compute the actual value of torque // transmitted to the wheels, according to gas throttle / speed / gear value. // The following is a very simplified model (the torque curve of the motor is linear // and no latency or inertial or clutch effects in gear train are considered.) double ComputeWheelTorque() { // Assume clutch is never used. Given the kinematics of differential, // the speed of the engine transmission shaft is the average of the two wheel speeds, // multiplied the conic gear transmission ratio inversed: double shaftspeed = (1.0 / this.conic_tau) * 0.5 * (this.link_engineL.Get_mot_rot_dt() + this.link_engineR.Get_mot_rot_dt()); // The motorspeed is the shaft speed multiplied by gear ratio inversed: double motorspeed = (1.0 / this.gear_tau) * shaftspeed; // The torque depends on speed-torque curve of the motor: here we assume a // very simplified model a bit like in DC motors: double motortorque = max_motor_torque - motorspeed * (max_motor_torque / max_motor_speed); // Motor torque is linearly modulated by throttle gas value: motortorque = motortorque * this.throttle; // The torque at motor shaft: double shafttorque = motortorque * (1.0 / this.gear_tau); // The torque at wheels - for each wheel, given the differential transmission, // it is half of the shaft torque (multiplied the conic gear transmission ratio) double singlewheeltorque = 0.5 * shafttorque * (1.0 / this.conic_tau); // Set the wheel torque in both 'engine' links, connecting the wheels to the truss; ChFunction_Const mfun1 = (ChFunction_Const)link_engineL.Get_tor_funct(); ChFunction_Const mfun2 = (ChFunction_Const)link_engineR.Get_tor_funct(); //if (mfun == link_engineL as ) mfun1.Set_yconst(singlewheeltorque); mfun2.Set_yconst(singlewheeltorque); // if (mfun = (ChFunction_Const)(link_engineR.Get_tor_funct())) // mfun.Set_yconst(singlewheeltorque); // debug:print infos on screen: // GetLog() << "motor torque="<< motortorque<< " speed=" << motorspeed << " wheel torqe=" << singlewheeltorque // <<"\n"; // If needed, return also the value of wheel torque: return(singlewheeltorque); }
public ChLinkMotorRotationSpeed() { variable.GetMass()[0, 0] = 1.0; variable.GetInvMass()[0, 0] = 1.0; m_func = new ChFunction_Const(1.0); rot_offset = 0; aux_dt = 0; // used for integrating speed, = rot aux_dtdt = 0; avoid_angle_drift = true; }
public ChLinkMotorLinearSpeed() { variable.GetMass()[0, 0] = 1.0; variable.GetInvMass()[0, 0] = 1.0; m_func = new ChFunction_Const(1.0); pos_offset = 0; aux_dt = 0; // used for integrating speed, = pos aux_dtdt = 0; avoid_position_drift = true; }
public ChLinkMotor() { m_func = new ChFunction_Const(0); // defaults to no motion. }
public ChFunction_Const(ChFunction_Const other) { C = other.C; }