コード例 #1
0
 /// Use this function after torque converter creation, to initialize it, given
 /// input and output shafts to join (plus the stator shaft, that should be fixed).
 /// Each shaft must belong to the same ChSystem.
 public bool Initialize(ChShaft mshaft1,      //< input shaft
                        ChShaft mshaft2,      //< output shaft
                        ChShaft mshaft_stator //< stator shaft (often fixed)
                        )
 {
     return(false);
 }
コード例 #2
0
 public ChShaftsBody(ChShaftsBody other)
 {
     torque_react = other.torque_react;
     shaft_dir    = other.shaft_dir;
     shaft        = null;
     body         = null;
 }
コード例 #3
0
 /// Use this function after planetary gear creation, to initialize it, given
 /// three shafts to join.
 /// Although there's no special requirement, you may think of the three
 /// typical moving parts of an epicycloidal reducer: the carrier, the
 /// input gear, and the gear with inner teeth that usually is kept fixed (but the
 /// ChShaftsPlanetary does not require that one shaft is fixed - it's up to you)
 /// Each shaft must belong to the same ChSystem.
 public bool Initialize(ChShaft mshaft1,  //< first  shaft to join (carrier wheel)
                        ChShaft mshaft2,  //< second shaft to join (wheel)
                        ChShaft mshaft3   //< third  shaft to join (wheel)
                        )
 {
     return(false);
 }
コード例 #4
0
        /// Use this function after gear creation, to initialize it, given two shafts to join.
        /// Each shaft must belong to the same ChSystem.
        /// Derived classes might overload this (here, basically it only sets the two pointers)
        public virtual bool Initialize(ChShaft mshaft1, //< first  shaft to join
                                       ChShaft mshaft2  //< second shaft to join
                                       )
        {
            ChShaft mm1 = mshaft1;
            ChShaft mm2 = mshaft2;

            // assert(mm1 && mm2);
            // assert(mm1 != mm2);
            // assert(mm1->GetSystem() == mm2->GetSystem());
            shaft1 = mm1;
            shaft2 = mm2;
            SetSystem(shaft1.GetSystem());
            return(true);
        }
コード例 #5
0
        /// Use this function after gear creation, to initialize it, given
        /// two shafts to join. The first shaft is the 'output' shaft of the motor,
        /// the second is the 'truss', often fixed and not rotating.
        /// The torque is applied to the output shaft, while the truss shafts
        /// gets the same torque but with opposite sign.
        /// Each shaft must belong to the same ChSystem.
        public override bool Initialize(ChShaft mshaft1, //< first  shaft to join (motor output shaft)
                                        ChShaft mshaft2  //< second shaft to join (motor truss)
                                        )
        {
            // Parent class initialize
            if (!base.Initialize(mshaft1, mshaft2))
            {
                return(false);
            }

            ChShaft mm1 = mshaft1;
            ChShaft mm2 = mshaft2;

            constraint.SetVariables(mm1.Variables(), mm2.Variables());

            SetSystem(shaft1.GetSystem());

            return(true);
        }
コード例 #6
0
        /// Use this function after object creation, to initialize it, given
        /// the 1D shaft and 3D body to join.
        /// Each item must belong to the same ChSystem.
        /// Direction is expressed in the local coordinates of the body.
        public bool Initialize(ChShaft mshaft,    //< shaft to join
                               ChBodyFrame mbody, //< body to join
                               ChVector mdir      //< the direction of the shaft on 3D body (applied on COG: pure torque)
                               )
        {
            ChShaft     mm1 = mshaft;
            ChBodyFrame mm2 = mbody;

            //Debug.Assert(mm1 == null && mm2 == null);

            shaft          = mm1;
            body.BodyFrame = mm2;
            shaft_dir      = ChVector.Vnorm(mdir);

            constraint.SetVariables(mm1.Variables(), mm2.Variables());

            SetSystem(shaft.GetSystem());
            return(true);
        }
コード例 #7
0
        public ChShaft(ChShaft other)
        {
            torque = other.torque;
            // system = other.system;
            pos        = other.pos;
            pos_dt     = other.pos_dt;
            pos_dtdt   = other.pos_dtdt;
            inertia    = other.inertia;
            mfixed     = other.mfixed;
            sleeping   = other.sleeping;
            limitspeed = other.limitspeed;

            variables = other.variables;

            max_speed = other.max_speed;

            sleep_time      = other.sleep_time;
            sleep_starttime = other.sleep_starttime;
            sleep_minspeed  = other.sleep_minspeed;
            sleep_minwvel   = other.sleep_minwvel;
        }
コード例 #8
0
        public ChShaft shaft2;  //< second shaft


        protected ChShaftsCouple()
        {
            shaft1 = null;
            shaft2 = null;
        }
コード例 #9
0
        public void Set_eng_mode(eCh_eng_mode mset)
        {
            if (Get_learn())
            {
                Set_learn(false);  // reset learn state when changing mode
            }
            if (eng_mode != mset)
            {
                eng_mode = mset;

                switch (eng_mode)
                {
                case eCh_eng_mode.ENG_MODE_ROTATION:
                case eCh_eng_mode.ENG_MODE_SPEED:
                case eCh_eng_mode.ENG_MODE_KEY_ROTATION:
                    ((ChLinkMaskLF)mask).Constr_E3().SetMode(eChConstraintMode.CONSTRAINT_LOCK);
                    break;

                case eCh_eng_mode.ENG_MODE_KEY_POLAR:
                    ((ChLinkMaskLF)mask).Constr_E1().SetMode(eChConstraintMode.CONSTRAINT_LOCK);
                    ((ChLinkMaskLF)mask).Constr_E2().SetMode(eChConstraintMode.CONSTRAINT_LOCK);
                    ((ChLinkMaskLF)mask).Constr_E3().SetMode(eChConstraintMode.CONSTRAINT_LOCK);
                    break;

                case eCh_eng_mode.ENG_MODE_TORQUE:
                    ((ChLinkMaskLF)mask).Constr_E3().SetMode(eChConstraintMode.CONSTRAINT_FREE);
                    break;

                case eCh_eng_mode.ENG_MODE_TO_POWERTRAIN_SHAFT:
                    ((ChLinkMaskLF)mask).Constr_E3().SetMode(eChConstraintMode.CONSTRAINT_FREE);
                    innerconstraint1 = gameObject.AddComponent <ChShaftsBody>();
                    innerconstraint2 = gameObject.AddComponent <ChShaftsBody>();
                    innershaft1      = gameObject.AddComponent <ChShaft>();
                    innershaft2      = gameObject.AddComponent <ChShaft>();
                    SetUpMarkers(marker1, marker2);      // to initialize innerconstraint1 innerconstraint2
                    break;
                }

                ChangedLinkMask();  // update all from new mask
            }

            if (eng_mode == eCh_eng_mode.ENG_MODE_KEY_ROTATION && rot_funct.Get_Type() != ChFunction.FunctionType.FUNCT_CONST)
            {
                rot_funct = new ChFunction_Const();
            }

            if (eng_mode == eCh_eng_mode.ENG_MODE_KEY_POLAR)
            {
                if (rot_funct.Get_Type() != ChFunction.FunctionType.FUNCT_CONST)
                {
                    rot_funct = new ChFunction_Const();
                }
                if (rot_funct_x.Get_Type() != ChFunction.FunctionType.FUNCT_CONST)
                {
                    rot_funct_x = new ChFunction_Const();
                }
                if (rot_funct_y.Get_Type() != ChFunction.FunctionType.FUNCT_CONST)
                {
                    rot_funct_y = new ChFunction_Const();
                }
            }
        }
コード例 #10
0
 public void SetShaft(ChShaft shaft)
 {
     m_shaft = shaft;
 }
コード例 #11
0
        private double m_inv_inertia; //< inverse of shaft inertia value


        public ChVariablesShaft() : base(1)
        {
            m_shaft       = null;
            m_inertia     = 1;
            m_inv_inertia = 1;
        }