コード例 #1
0
        public static void InitializeVariables(SuspensionCoordinatesMaster _scmTransIP, SuspensionCoordinatesMaster _scmTransOP, double _ioX, double _ioY, double _ioZ)
        {
            #region Initializing the Local Coordinate Variables for Double Wishbone
            //
            //Fixed or Inboard Points
            //

            ///<remarks>
            ///Irrespective of whether the Car is brought from the Stands to th ground or is being given a motion, I am passing the Input Coordinates of Suspension to this Initialization method.
            ///Hence, I am going to first translate it to the local coordinate system
            /// </remarks>
            _scmTransOP.A1x  = _scmTransIP.A1x - _ioX;    _scmTransOP.A1y = _scmTransIP.A1y - _ioY;    _scmTransOP.A1z = _scmTransIP.A1z - _ioZ;
            _scmTransOP.B1x  = _scmTransIP.B1x - _ioX;    _scmTransOP.B1y = _scmTransIP.B1y - _ioY;    _scmTransOP.B1z = _scmTransIP.B1z - _ioZ;
            _scmTransOP.C1x  = _scmTransIP.C1x - _ioX;    _scmTransOP.C1y = _scmTransIP.C1y - _ioY;    _scmTransOP.C1z = _scmTransIP.C1z - _ioZ;
            _scmTransOP.D1x  = _scmTransIP.D1x - _ioX;    _scmTransOP.D1y = _scmTransIP.D1y - _ioY;    _scmTransOP.D1z = _scmTransIP.D1z - _ioZ;
            _scmTransOP.I1x  = _scmTransIP.I1x - _ioX;    _scmTransOP.I1y = _scmTransIP.I1y - _ioY;    _scmTransOP.I1z = _scmTransIP.I1z - _ioZ;
            _scmTransOP.JO1x = _scmTransIP.JO1x - _ioX;  _scmTransOP.JO1y = _scmTransIP.JO1y - _ioY;  _scmTransOP.JO1z = _scmTransIP.JO1z - _ioZ;
            _scmTransOP.N1x  = _scmTransIP.N1x - _ioX;    _scmTransOP.N1y = _scmTransIP.N1y - _ioY;    _scmTransOP.N1z = _scmTransIP.N1z - _ioZ;

            _scmTransOP.Pin1x = _scmTransIP.Pin1x - _ioX; _scmTransOP.Pin1y = _scmTransIP.Pin1y - _ioY; _scmTransOP.Pin1z = _scmTransIP.Pin1z - _ioZ;
            _scmTransOP.UV1x  = _scmTransIP.UV1x - _ioX; _scmTransOP.UV1y = _scmTransIP.UV1y - _ioY; _scmTransOP.UV1z = _scmTransIP.UV1z - _ioZ;
            _scmTransOP.UV2x  = _scmTransIP.UV2x - _ioX; _scmTransOP.UV2y = _scmTransIP.UV2y - _ioY; _scmTransOP.UV2z = _scmTransIP.UV2z - _ioZ;
            _scmTransOP.STC1x = _scmTransIP.STC1x - _ioX; _scmTransOP.STC1y = _scmTransIP.STC1y - _ioY; _scmTransOP.STC1z = _scmTransIP.STC1z - _ioZ;

            _scmTransOP.Q1x            = _scmTransIP.Q1x - _ioX;    _scmTransOP.Q1y = _scmTransIP.Q1y - _ioY;    _scmTransOP.Q1z = _scmTransIP.Q1z - _ioZ;
            _scmTransOP.R1x            = _scmTransIP.R1x - _ioX;    _scmTransOP.R1y = _scmTransIP.R1y - _ioY;    _scmTransOP.R1z = _scmTransIP.R1z - _ioZ;
            _scmTransOP.RideHeightRefx = _scmTransIP.RideHeightRefx - _ioX; _scmTransOP.RideHeightRefy = _scmTransIP.RideHeightRefy - _ioY; _scmTransOP.RideHeightRefz = _scmTransIP.RideHeightRefz - _ioZ;

            #endregion
        }
コード例 #2
0
        /// <summary>
        /// Method to initialize all the Axes involved in the wheel assembly.Called only once during 1st time initialization which happenes using <see cref="SetupChangeDatabase()"/> construction
        /// </summary>
        /// <param name="scm">Object of the SuspensionCoordinateMaster Class</param>
        public void InitializePointsAndVectors(SetupChange_CornerVariables sccv, SuspensionCoordinatesMaster scm, Dictionary <string, AdjustmentTools> adjToolDictionary)
        {
            ///<summary>Creating a vector out the Spindle End Coordinates so that I can use the Mathnet.Euclidean functions to calcualate its angles with respect to space</summary>
            WheelSpindle = new Custom3DGeometry(new Point3D(scm.K1x, scm.K1y, scm.K1z), new Point3D(scm.L1x, scm.L1y, scm.L1z));

            ///<summary>Creating the contact patch point</summary>
            ContactPatch = new ChildPoint_VariablePoint(new Point3D(scm.W1x, scm.W1y, scm.W1z));

            ///<summary>Creatng the Ball Joints</summary>
            LBJ            = new Point3D(scm.E1x, scm.E1y, scm.E1z);
            UBJ            = new Point3D(scm.F1x, scm.F1y, scm.F1z);
            ToeLinkUpright = new Point3D(scm.M1x, scm.M1y, scm.M1z);

            ///<summary>Initializing axes passing through the wheel centre. These will be used to initialize other axes</summary>
            WheelCentreAxis = new StandardAxesLines(new Point3D(scm.K1x, scm.K1y, scm.K1z), new Point3D(scm.K1x, scm.K1y, scm.K1z + 100),
                                                    new Point3D(scm.K1x, scm.K1y, scm.K1z), new Point3D(scm.K1x + 100, scm.K1y, scm.K1z),
                                                    new Point3D(scm.K1x, scm.K1y, scm.K1z), new Point3D(scm.K1x, scm.K1y + 100, scm.K1z));

            ///<summary>
            ///Initializing the SteeringAxis Vector
            ///</summary>
            ///<remarks>Initialization of the Steering Axis</remarks>
            SteeringAxis = new Custom3DGeometry(LBJ, UBJ);
            InitializeAuxillaries(0);

            UprightTriangle.Add(new Triangle(/*new Point3D(UBJ.X, UBJ.Y, UBJ.Z),*/ UBJ, /*new Point3D(LBJ.X, LBJ.Y, LBJ.Z)*/ LBJ, /* new Point3D(ToeLinkUpright.X, ToeLinkUpright.Y, ToeLinkUpright.Z)*/ ToeLinkUpright));

            ///<summary>Initializing the <see cref="LBJToToeLink"/> Vector</summary>
            LBJToToeLink = new Custom3DGeometry(LBJ, ToeLinkUpright);
            ///<summary>Initializing the <see cref="UBJToToeLink"/> Vector</summary>
            UBJToToeLink = new Custom3DGeometry(UBJ, ToeLinkUpright);

            ///<summary></summary>
            AdjOptions = new AdjustmentOptions(scm, this, adjToolDictionary, sccv);
        }
コード例 #3
0
        public static List <OutputClass> AssignVehicleParams_Custom_OC_BumpSteer(SuspensionCoordinatesMaster _scm, VehicleCorner _vCorner, Vehicle _vehicle, int noOfOCSteps)
        {
            List <OutputClass> oc = new List <OutputClass>();

            oc = _vehicle.Initialize_IndependantOutputClass(noOfOCSteps, (int)_vCorner, _scm);

            return(oc);
        }
コード例 #4
0
        private void CalculateOutboardPoints(OutputClass _ocOut, SuspensionCoordinatesMaster _scmOut)
        {
            // TO CALCULATE THE NEW POSITION OF J i.e., TO CALCULATE J'
            // Vectors used -> J'Jo, J'D & J'C
            double XJ1 = 0, YJ1 = 0, ZJ1 = 0;

            QuadraticEquationSolver.Solver(l_J1x, l_J1y, l_J1z, l_JO1x, l_JO1y, l_JO1z, _ocOut.DamperLength, l_D1x, l_D1y, l_D1z, l_C1x, l_C1y, l_C1z, l_JO1x, l_JO1y, l_JO1z, l_D1x, l_D1y, l_D1z, l_C1x, l_C1y, l_C1z, l_JO1y, true, out XJ1, out YJ1, out ZJ1);

            _ocOut.scmOP.J1x = XJ1;
            _ocOut.scmOP.J1y = YJ1;
            _ocOut.scmOP.J1z = ZJ1;

            // TO CALCULATE THE NEW POSITION OF E i.e., TO CALCULATE E'
            // Vectors used -> E'J', E'C & E'D
            double XE1 = 0, YE1 = 0, ZE1 = 0;

            QuadraticEquationSolver.Solver(l_E1x, l_E1y, l_E1z, l_J1x, l_J1y, l_J1z, 0, l_C1x, l_C1y, l_C1z, l_D1x, l_D1y, l_D1z, _ocOut.scmOP.J1x, _ocOut.scmOP.J1y, _ocOut.scmOP.J1z, l_C1x, l_C1y, l_C1z, l_D1x, l_D1y, l_D1z, _ocOut.scmOP.J1y, true, out XE1, out YE1, out ZE1);

            _ocOut.scmOP.E1x = XE1;
            _ocOut.scmOP.E1y = YE1;
            _ocOut.scmOP.E1z = ZE1;

            CalculateFinaMotionRatio(_ocOut, _scmOut);

            // TO CALCULATE THE NEW POSITION OF M i.e., TO CALCULATE M'
            // Vectors used -> M'E', M'J' & M'N
            double XM1 = 0, YM1 = 0, ZM1 = 0;

            QuadraticEquationSolver.Solver(l_M1x, l_M1y, l_M1z, l_E1x, l_E1y, l_E1z, 0, l_J1x, l_J1y, l_J1z, l_N1x, l_N1y, l_N1z, _ocOut.scmOP.E1x, _ocOut.scmOP.E1y, _ocOut.scmOP.E1z, _ocOut.scmOP.J1x, _ocOut.scmOP.J1y, _ocOut.scmOP.J1z, l_N1x, l_N1y, l_N1z, l_JO1y, true, out XM1, out YM1, out ZM1);

            _ocOut.scmOP.M1x = XM1;
            _ocOut.scmOP.M1y = YM1;
            _ocOut.scmOP.M1z = ZM1;

            _ocOut.scmOP.N1x = l_N1x;
            _ocOut.scmOP.N1y = l_N1y;
            _ocOut.scmOP.N1z = l_N1z;

            // TO CALCULATE THE NEW POSITION OF K i.e., TO CALCULATE K'
            // Vectors used -> K'M', K'J' & K'E'
            double XK1 = 0, YK1 = 0, ZK1 = 0;

            QuadraticEquationSolver.Solver(l_K1x, l_K1y, l_K1z, l_M1x, l_M1y, l_M1z, 0, l_J1x, l_J1y, l_J1z, l_E1x, l_E1y, l_E1z, _ocOut.scmOP.M1x, _ocOut.scmOP.M1y, _ocOut.scmOP.M1z, _ocOut.scmOP.J1x, _ocOut.scmOP.J1y, _ocOut.scmOP.J1z, _ocOut.scmOP.E1x, _ocOut.scmOP.E1y, _ocOut.scmOP.E1z, _ocOut.scmOP.J1y, true, out XK1, out YK1, out ZK1);

            _ocOut.scmOP.K1x = XK1;
            _ocOut.scmOP.K1y = YK1;
            _ocOut.scmOP.K1z = ZK1;

            // TO CALCULATE THE NEW POSITION OF P i.e., TO CALCULATE P'
            // Vectors used -> P'O', P'Q & P'D
            double XP1 = 0, YP1 = 0, ZP1 = 0;

            QuadraticEquationSolver.Solver(l_P1x, l_P1y, l_P1z, l_E1x, l_E1y, l_E1z, 0, l_Q1x, l_Q1y, l_Q1z, l_J1x, l_J1y, l_J1z, _ocOut.scmOP.E1x, _ocOut.scmOP.E1y, _ocOut.scmOP.E1z, l_Q1x, l_Q1y, l_Q1z, _ocOut.scmOP.J1x, _ocOut.scmOP.J1y, _ocOut.scmOP.J1z, _ocOut.scmOP.J1y, true, out XP1, out YP1, out ZP1);

            _ocOut.scmOP.P1x = XP1;
            _ocOut.scmOP.P1y = YP1;
            _ocOut.scmOP.P1z = ZP1;
        }
コード例 #5
0
        private void CalculateFinaMotionRatio(OutputClass _ocMR, SuspensionCoordinatesMaster _scmMR)
        {
            //Final Motion Ratio for McPherson Strut
            double J2JO_Perp, J2JO, alpha;

            J2JO_Perp          = Math.Abs(_ocMR.scmOP.J1x - l_JO1x);
            J2JO               = Math.Sqrt(Math.Pow((_ocMR.scmOP.J1x - l_JO1x), 2) + Math.Pow((_ocMR.scmOP.J1y - l_JO1y), 2));
            alpha              = Math.Asin(J2JO_Perp / J2JO);
            _ocMR.FinalMR      = Math.Acos(alpha);
            _ocMR.Final_ARB_MR = (_scmMR.O1I / _scmMR.P1Q) * (Math.Cos(alpha));
        }
コード例 #6
0
        /// <summary>
        /// Method to obtain the Suspension Coordinates of the corner for which wre want to plot the Bobillier Line
        /// </summary>
        /// <param name="_scm"></param>
        public void AssignLocalSuspensionObject(Vehicle _vehicle, SuspensionCoordinatesMaster _scm, int _identifier)
        {
            if (_scm != null)
            {
                SCM = _scm;
            }
            if (_vehicle != null)
            {
                Vehicle = _vehicle;
            }

            Corner = (VehicleCorner)_identifier;
        }
コード例 #7
0
        //private void InitUprightBasedOnAdjustmentTool(Dictionary<string, AdjustmentTools> _adjToolDictionary, SetupChangeDatabase _scd)
        //{
        //    if (_adjToolDictionary["CamberChange"] == AdjustmentTools.TopCamberMount)
        //    {
        //        GetNewUprightTrianglePosition(ref _scd.UprightTriangle, TopCamberShimsLine[TopCamberShimsLine.Count - 1].EndPoint, _scd.LBJ, _scd.ToeLinkUpright, _scd);
        //    }
        //    else if (_adjToolDictionary["CamberChange"] == AdjustmentTools. BottomCamberMount)
        //    {

        //    }


        //}

        /// <summary>
        /// Method to get a Vector and Line which represent the group of Shims.These maybe camber shims at the Camber Mount or Link Shims at the Wishbone Arms (or Toe Link) Obtained by drawing a line at the UBJ or LBJ on the Wishbone Plane and then making it parallel in the
        /// Top View with the Wheel Spindle
        /// </summary>
        /// <param name="_scmPlane"></param>
        /// <param name="_scd"></param>
        /// <param name="_camberShimsLine"></param>
        /// <param name="_camberShimsVector"></param>
        /// <param name="_wishbonePlane"></param>
        /// <param name="_UBJorLBJ"></param>
        private void InitializeShimsGeometry(SuspensionCoordinatesMaster _scmPlane, SetupChangeDatabase _scd, List <Line> _camberShimsLine, List <Vector3D> _camberShimsVector, Plane _wishbonePlane, Point3D _UBJorLBJ)
        {
            ///<summary>Creating a temp line to represent the Camber Shims Line and will added to the <see cref="BottomCamberShimsLine"/> OR <see cref="TopCamberShimsLine"/></summary>
            ///<remarks>
            ///COordinate are passed as (0,0) and (5,0). This is becase the <see cref="TopWishbonePlane"/> and <see cref="BottomWishbonePlane"/> have the UBJ and LBJ as their origins.
            ///Hence, you need to pass 0,0 and 5,0 so that the Camber Line starts at UBJ and extends by 5 in X direction
            ///</remarks>
            Line _tempCamberShimsLine = new Line(_wishbonePlane, /*_UBJorLBJ.X*/ 0, /*_UBJorLBJ.Z*/ 0, /*_UBJorLBJ.X + */ 5, /*_UBJorLBJ.Z*/ 0);


            Angle angle = SetupChangeDatabase.AngleInRequiredView(Custom3DGeometry.GetMathNetVector3D(new Line(_tempCamberShimsLine.StartPoint.X, 0, _tempCamberShimsLine.StartPoint.Z, _tempCamberShimsLine.EndPoint.X, 0, _tempCamberShimsLine.EndPoint.Z)),
                                                                  Custom3DGeometry.GetMathNetVector3D(new Line(_scd.WheelSpindle.Line.DeltaLine[0].StartPoint.X, 0, _scd.WheelSpindle.Line.DeltaLine[0].StartPoint.Z,
                                                                                                               _scd.WheelSpindle.Line.DeltaLine[0].EndPoint.X, 0, _scd.WheelSpindle.Line.DeltaLine[0].EndPoint.Z)),
                                                                  Custom3DGeometry.GetMathNetVector3D(_scd.WheelCentreAxis.Vertical));

            _tempCamberShimsLine.Rotate(-angle.Radians, _tempCamberShimsLine.StartPoint, new Point3D(_tempCamberShimsLine.StartPoint.X, _tempCamberShimsLine.StartPoint.Y + 100, _tempCamberShimsLine.StartPoint.Z));

            _camberShimsLine.Add(_tempCamberShimsLine);

            _camberShimsVector.Add(new Vector3D(new Point3D(_tempCamberShimsLine.StartPoint.X, _tempCamberShimsLine.StartPoint.Y, _tempCamberShimsLine.StartPoint.Z), new Point3D(_tempCamberShimsLine.EndPoint.X, _tempCamberShimsLine.EndPoint.Y, _tempCamberShimsLine.EndPoint.Z)));
        }
コード例 #8
0
        /// <summary>
        /// Method to Initialize all the Adjustment tools and decide which the Master Adjusters are going to be
        /// </summary>
        /// <param name="scm"></param>
        /// <param name="scd"></param>
        /// <param name="adjToolDictionary">Dictionary which is initialized with all the <see cref="AdjustmentTools"/> the user has selected for each Setup Change</param>
        public AdjustmentOptions(SuspensionCoordinatesMaster scm, SetupChangeDatabase scd, Dictionary <string, AdjustmentTools> adjToolDictionary, SetupChange_CornerVariables sccv)
        {
            TopWishbonePlane = new Plane(new Point3D(scm.F1x, scm.F1y, scm.F1z), new Point3D(scm.A1x, scm.A1y, scm.A1z), new Point3D(scm.B1x, scm.B1y, scm.B1z));

            TopFrontArm.Add(new Line(new Point3D(scm.A1x, scm.A1y, scm.A1z), new Point3D(scm.F1x, scm.F1y, scm.F1z) /*scd.UBJ*/));

            TopFrontVector.Add(new Vector3D(TopFrontArm[TopFrontArm.Count - 1].StartPoint, TopFrontArm[TopFrontArm.Count - 1].EndPoint));

            TopRearArm.Add(new Line(new Point3D(scm.B1x, scm.B1y, scm.B1z), new Point3D(scm.F1x, scm.F1y, scm.F1z) /*scd.UBJ*/));

            TopRearVector.Add(new Vector3D(TopRearArm[TopRearArm.Count - 1].StartPoint, TopRearArm[TopRearArm.Count - 1].EndPoint));

            BottomWishbonePlane = new Plane(new Point3D(scm.E1x, scm.E1y, scm.E1z), new Point3D(scm.D1x, scm.D1y, scm.D1z), new Point3D(scm.C1x, scm.C1y, scm.C1z));

            BottomFrontArm.Add(new Line(new Point3D(scm.D1x, scm.D1y, scm.D1z), new Point3D(scm.E1x, scm.E1y, scm.E1z) /*scd.LBJ*/));

            BottomFrontArmVector.Add(new Vector3D(BottomFrontArm[BottomFrontArm.Count - 1].StartPoint, BottomFrontArm[BottomFrontArm.Count - 1].EndPoint));

            BottomRearArm.Add(new Line(new Point3D(scm.C1x, scm.C1y, scm.C1z), new Point3D(scm.E1x, scm.E1y, scm.E1z) /*scd.LBJ*/));

            BottomRearArmVector.Add(new Vector3D(BottomRearArm[BottomRearArm.Count - 1].StartPoint, BottomRearArm[BottomRearArm.Count - 1].EndPoint));

            MToeAdjusterLine.Add(new Line(new Point3D(scm.N1x, scm.N1y, scm.N1z), new Point3D(scm.M1x, scm.M1y, scm.M1z) /*scd.ToeLinkUpright*/));

            MToeAdjusterVector.Add(new Vector3D(MToeAdjusterLine[MToeAdjusterLine.Count - 1].StartPoint, MToeAdjusterLine[MToeAdjusterLine.Count - 1].EndPoint));

            PushrodLine.Add(new Line(new Point3D(scm.J1x, scm.J1y, scm.J1z), new Point3D(scm.G1x, scm.G1y, scm.G1z)));

            PushrodVector.Add(new Vector3D(PushrodLine[PushrodLine.Count - 1].StartPoint, PushrodLine[PushrodLine.Count - 1].EndPoint));

            InitializeShimsGeometry(scm, scd, TopCamberShimsLine, TopCamberShimsVector, TopWishbonePlane, scd.UBJ);

            InitializeShimsGeometry(scm, scd, BottomCamberShimsLine, BottomCamberShimsVector, BottomWishbonePlane, scd.LBJ);

            //InitUprightBasedOnAdjustmentTool(adjToolDictionary, scd);

            AssignMasterAdjusters(sccv, adjToolDictionary, scd);
        }
コード例 #9
0
        /// <summary>
        /// Method to Initialize ALL the <see cref="Point3D"/>s using a <see cref="SuspensionCoordinatesMaster"/> object
        /// </summary>
        public void Initialize_Points(SuspensionCoordinatesMaster _scm)
        {
            OutboardAssembly = new Dictionary <string, Point3D>();

            InboardAssembly = new Dictionary <string, Point3D>();

            ///---INBOARD POINTS

            ///Upper Front
            UpperFront = new Point3D(_scm.A1x, _scm.A1y, _scm.A1z);
            InboardAssembly.Add(CoordinateOptions.UpperFront.ToString(), UpperFront);

            ///Upper Rear
            UpperRear = new Point3D(_scm.B1x, _scm.B1y, _scm.B1z);
            InboardAssembly.Add(CoordinateOptions.UpperRear.ToString(), UpperRear);

            ///Lower Front
            LowerFront = new Point3D(_scm.D1x, _scm.D1y, _scm.D1z);
            InboardAssembly.Add(CoordinateOptions.LowerFront.ToString(), LowerFront);

            ///Lower Rear
            LowerRear = new Point3D(_scm.C1x, _scm.C1y, _scm.C1z);
            InboardAssembly.Add(CoordinateOptions.LowerRear.ToString(), LowerRear);

            ///Toe Link Inboard
            ToeLinkInboard = new Point3D(_scm.N1x, _scm.N1y, _scm.N1z);
            InboardAssembly.Add(CoordinateOptions.ToeLinkInboard.ToString(), ToeLinkInboard);

            ///Pushrod Inboard
            PushrodInboard = new Point3D(_scm.H1x, _scm.H1y, _scm.H1z);
            InboardAssembly.Add(CoordinateOptions.PushrodInboard.ToString(), PushrodInboard);

            ///Damper BellCrank
            DamperBellCrank = new Point3D(_scm.J1x, _scm.J1y, _scm.J1z);
            InboardAssembly.Add(CoordinateOptions.DamperBellCrank.ToString(), DamperBellCrank);

            ///Damper Chassis Shock Mount
            DamperShockMount = new Point3D(_scm.JO1x, _scm.JO1y, _scm.JO1z);
            InboardAssembly.Add(CoordinateOptions.DamperShockMount.ToString(), DamperShockMount);


            ///---OUTBOARD POINTS


            ///UBJ
            UBJ = new Point3D(_scm.F1x, _scm.F1y, _scm.F1z);
            OutboardAssembly.Add(CoordinateOptions.UBJ.ToString(), UBJ);

            ///Top Camber Mount
            TopCamberMount = new Point3D(_scm.TCM1x, _scm.TCM1y, _scm.TCM1z);
            OutboardAssembly.Add(CoordinateOptions.TopCamberMount.ToString(), /*UBJ.Clone() as Point3D*/ TopCamberMount);

            ///Pushrod Outboard
            PushrodOutboard = new Point3D(_scm.G1x, _scm.G1y, _scm.G1z);
            OutboardAssembly.Add(CoordinateOptions.PushrodOutboard.ToString(), PushrodOutboard);

            ///LBJ
            LBJ = new Point3D(_scm.E1x, _scm.E1y, _scm.E1z);
            OutboardAssembly.Add(CoordinateOptions.LBJ.ToString(), LBJ);

            ///Bottom Camber Mount
            BottomCamberMount = new Point3D(_scm.BCM1x, _scm.BCM1y, _scm.BCM1z);
            OutboardAssembly.Add(CoordinateOptions.BottomCamberMount.ToString(), BottomCamberMount);

            ///Wheel Center
            WheelCenter = new Point3D(_scm.K1x, _scm.K1y, _scm.K1z);
            OutboardAssembly.Add(CoordinateOptions.WheelCenter.ToString(), WheelCenter);

            ///Wheel Spindle End
            WcEnd = new Point3D(_scm.L1x, _scm.L1y, _scm.L1z);
            OutboardAssembly.Add("WcEnd", WcEnd);

            ///Toe Link Outboard
            ToeLinkOutboard = new Point3D(_scm.M1x, _scm.M1y, _scm.M1z);
            OutboardAssembly.Add(CoordinateOptions.ToeLinkOutboard.ToString(), ToeLinkOutboard);

            ///Contact Patch
            ContactPatch = new Point3D(_scm.W1x, _scm.W1x, _scm.W1z);
            OutboardAssembly.Add("ContactPatch", ContactPatch);


            AxisLines_WheelCenter = new Dictionary <string, Line>();

            AxisLines_WheelCenter.Add("SteeringAxis", new Line(UBJ.Clone() as Point3D, LBJ.Clone() as Point3D));

            AxisLines_WheelCenter.Add("SteeringAxis_Ref", new Line(UBJ.Clone() as Point3D, LBJ.Clone() as Point3D));

            AxisLines_WheelCenter.Add("LateralAxis_WheelCenter", new Line(WheelCenter.Clone() as Point3D, new Point3D(WheelCenter.X + 100, WheelCenter.Y, WheelCenter.Z)));

            AxisLines_WheelCenter.Add("WheelSpindle", new Line(WheelCenter.Clone() as Point3D, WcEnd.Clone() as Point3D));

            AxisLines_WheelCenter.Add("WheelSpindle_Ref", new Line(WheelCenter.Clone() as Point3D, WcEnd.Clone() as Point3D));

            AxisLines_WheelCenter.Add("VerticalAxis_WheelCenter", new Line(WheelCenter.Clone() as Point3D, new Point3D(WheelCenter.X, WheelCenter.Y + 100, WheelCenter.Z)));

            AxisLines_WheelCenter.Add("LongitudinalAxis_WheelCenter", new Line(WheelCenter.Clone() as Point3D, new Point3D(WheelCenter.X, WheelCenter.Y, WheelCenter.Z + 100)));
        }
コード例 #10
0
        //Kinematics Solver for McPherson Suspension
        public void KinematicsMcPherson(int Identifier, SuspensionCoordinatesMaster scm, WheelAlignment wa, Tire tire, AntiRollBar arb, double ARB_Rate_Nmm, Spring spring, Damper damper, List <OutputClass> oc, Vehicle _vehicleForMcPherson, List <double> WheelOrSpringDeflections, bool MotionExists, bool RecalculateSteering /*, bool FirstIteration*/)
        {
            dummy1 = dummy2 = 0;

            #region Initialization methods

            ///<remarks>
            ///The IF loop is employed so that if the < c > Kinematics </ c > method is being run to calculate the Points for Steering then local coordinate variables should be initialized with the Output Class coordinates rather than the Input Suspension Coordinates as
            ///the method has already been executed and is been run for the second time for the purpose of calcualting steering
            /// </remarks>

            // Initialization of the Local Coordinate variables
            if (!RecalculateSteering)
            {
                AssignLocalCoordinateVariables_FixesPoints(scm);
                AssignLocalCoordinateVariables_MovingPoints(scm);
            }
            else if (RecalculateSteering)
            {
                AssignLocalCoordinateVariables_FixesPoints(oc[dummy1].scmOP);
                AssignLocalCoordinateVariables_MovingPoints(oc[dummy1].scmOP);
                L1x = oc[dummy1].scmOP.L1x; L1y = oc[dummy1].scmOP.L1y; L1z = oc[dummy1].scmOP.L1z;
            }


            if (MotionExists)
            {
                N = _vehicleForMcPherson.vehicle_Motion.Final_WheelDeflectionsY.Count;

                // Initializating the Local Wheel Alignment variables
                InitializeWheelAlignmentVariables(wa, oc[dummy1], Identifier, _vehicleForMcPherson.vehicle_Motion.SteeringExists);

                // Initialize array which holds the previous value of spring deflection
                SpringDeflection_Prev = new double[_vehicleForMcPherson.vehicle_Motion.Final_WheelDeflectionsX.Count];
            }
            else if (!MotionExists)
            {
                N = 200;

                // Initializating the Local Wheel Alignment variables
                InitializeWheelAlignmentVariables(wa, oc[dummy1], Identifier, false);
            }


            //  The value of Ride will be calculated at the end as the relative value of Ride Height. This will be used to translate all the coordinates to reflect the car falling on the ground.



            if (!RecalculateSteering)
            {
                ///<remarks> Resetting the wheel defelction due to steering to prevent residue error</remarks>
                for (int i = 0; i < 100; i++)
                {
                    scm.WheelDeflection_Steering[i] = 0;
                }

                // Converting Coordinates from World Coordinate System to Car Coordinate System
                TranslateToLocalCS(_vehicleForMcPherson.sc_FL);


                // Initializing the Spindle End
                InitializeSpindleEndCoordinates(tire);


                // To Calculate position of far end of the spindle vector using Static Camber and Toe
                RotateSpindleVector(oc[dummy1].waOP.StaticCamber, oc[dummy1].waOP.StaticToe, false, 0, 0, 0, 0, 0, 0, Lx, Ly, Lz, out L1x, out L1y, out L1z);


                // Initial Motion Ratio for McPherson Strut
                scm.MotionRatio(_vehicleForMcPherson.McPhersonFront, _vehicleForMcPherson.McPhersonRear, _vehicleForMcPherson.PullRodIdentifierFront, _vehicleForMcPherson.PullRodIdentifierRear, Identifier);
                // Passing the Motion Ratio to the Output Class
                oc[dummy1].InitialMR      = scm.InitialMR;
                oc[dummy1].Initial_ARB_MR = scm.Initial_ARB_MR;

                // Preliminary Calculations to find the New Camber and Toe
                CalculateInitialSpindleVector();
            }
            #endregion


            #region Wheel Deflection Calculations for Stand to Ground Calculations
            if (!MotionExists)
            {
                //
                //Only for Stand to Ground
                //

                CalculateWheelAndSpringDeflection(scm, spring, damper, _vehicleForMcPherson, null, oc[0], tire, Identifier, ARB_Rate_Nmm, MotionExists, RecalculateSteering, 0);
            }
            #endregion


            #region For Loop to Calculate the SUSPENSION POINTS

            for (a1 = 1; a1 < N; a1++)
            {
                oc[dummy1].scmOP.NoOfCouplings = _vehicleForMcPherson.sc_FL.NoOfCouplings;

                #region Wheel Deflection Calculations for Motion Calculation
                if (MotionExists && ((!RecalculateSteering) /*|| ((RecalculateRearSteering) && (Identifier == 3 || Identifier == 4) && dummy1 != 0)*/))
                {
                    //
                    // For Motion Simulation
                    //
                    CalculateWheelAndSpringDeflection(scm, spring, damper, _vehicleForMcPherson, WheelOrSpringDeflections, oc[dummy1], tire, Identifier, ARB_Rate_Nmm, MotionExists, RecalculateSteering, dummy1);
                }
                else if (MotionExists && (RecalculateSteering /*&& (Identifier == 1 || Identifier == 2)*/))
                {
                    CalculateSpringDeflection_AfterVehicleModel(oc, Identifier, WheelOrSpringDeflections[dummy1], oc[dummy1].FinalMR, dummy1);
                }
                #endregion

                #region Confirm if needed and delete if not
                ///////<remarks>
                ///////The IF loop is employed so that if the < c > Kinematics </ c > method is being run to calculate the Points for Steering then local coordinate variables should be initialized with the Output Class coordinates rather than the Input Suspension Coordinates as
                ///////the method has already been executed and is been run for the second time for the purpose of calcualting steering
                ///////This loop is executed only once as the
                /////// </remarks>
                //if (RecalculateSteering && dummy1 != 0)
                //{
                //    AssignLocalCoordinateVariables_FixesPoints(oc[dummy1].scmOP);
                //    AssignLocalCoordinateVariables_MovingPoints(oc[dummy1].scmOP);
                //    L1x = oc[dummy1].scmOP.L1x; L1y = oc[dummy1].scmOP.L1y; L1z = oc[dummy1].scmOP.L1z;
                //}
                #endregion

                #region Progress Bar Operations
                _vehicleForMcPherson.vehicleGUI.ProgressBarVehicleGUI.PerformStep();
                _vehicleForMcPherson.vehicleGUI.ProgressBarVehicleGUI.Update();
                #endregion

                #region Calculating the deflection of the spring in Steps
                CalculateAngleOfRotationOrDamperLength(oc[dummy1], MotionExists, dummy1, damper, RecalculateSteering);
                #endregion

                #region Calculating the Caster and KPI
                CalculateKPIandCaster(oc[dummy1], false, Identifier);
                #endregion

                if (!RecalculateSteering || ((RecalculateSteering) && (Identifier == 3 || Identifier == 4)))
                {
                    #region Calculate the remaining Outboard Points
                    CalculateOutboardPoints(oc[dummy1], scm);
                    #endregion

                    #region Point L - Wheel Spindle End
                    // TO CALCULATE THE NEW POSITION OF L i.e., TO CALCULATE L'
                    // Vectors used -> L'M', L'J' & L'E'   // THE INITIAL COORDINATES OF L SHOULD NOT BE TAKEN FROM USER. THEY SHOULD BE CALCULATED USING 'K' , THE INPUT CAMBER AND TOE
                    double XL1 = 0, YL1 = 0, ZL1 = 0;
                    QuadraticEquationSolver.Solver(L1x, L1y, L1z, l_M1x, l_M1y, l_M1z, 0, l_J1x, l_J1y, l_J1z, l_E1x, l_E1y, l_E1z, oc[dummy1].scmOP.M1x, oc[dummy1].scmOP.M1y, oc[dummy1].scmOP.M1z, oc[dummy1].scmOP.J1x, oc[dummy1].scmOP.J1y, oc[dummy1].scmOP.J1z, oc[dummy1].scmOP.E1x, oc[dummy1].scmOP.E1y, oc[dummy1].scmOP.E1z, oc[dummy1].scmOP.J1y * 2, true, out XL1, out YL1, out ZL1);

                    oc[dummy1].scmOP.L1x = XL1;
                    oc[dummy1].scmOP.L1y = YL1;
                    oc[dummy1].scmOP.L1z = ZL1;
                    #endregion

                    #region Point W - Contact Patch
                    // TO CALCULATE THE NEW POSITION OF W i.e., TO CALCULATE W'
                    // Vectors used -> W'L', W'J' & W'E'
                    double XW1 = 0, YW1 = 0, ZW1 = 0;
                    QuadraticEquationSolver.Solver(l_W1x, l_W1y, l_W1z, L1x, L1y, L1z, 0, l_J1x, l_J1y, l_J1z, l_E1x, l_E1y, l_E1z, oc[dummy1].scmOP.L1x, oc[dummy1].scmOP.L1y, oc[dummy1].scmOP.L1z, oc[dummy1].scmOP.J1x, oc[dummy1].scmOP.J1y, oc[dummy1].scmOP.J1z, oc[dummy1].scmOP.E1x, oc[dummy1].scmOP.E1y, oc[dummy1].scmOP.E1z, oc[dummy1].scmOP.E1y, true, out XW1, out YW1, out ZW1);

                    oc[dummy1].scmOP.W1x = XW1;
                    oc[dummy1].scmOP.W1y = YW1;
                    oc[dummy1].scmOP.W1z = ZW1;
                    #endregion
                }

BreakPointA:
                //Calculating the Tire Loaded Radius
                oc[dummy1].TireLoadedRadius = (l_K1y - l_W1y) + (_vehicleForMcPherson.CW[Identifier - 1] / tire.TireRate);

                //Calculating The Final Ride Height
                oc[dummy1].FinalRideHeight = Math.Abs((oc[dummy1].scmOP.W1y) - l_RideHeightRefy + (_vehicleForMcPherson.CW[Identifier - 1] / tire.TireRate));

                if (_vehicleForMcPherson.Vehicle_Results_Tracker == 0)
                {
                    oc[dummy1].FinalRideHeight_1 = oc[dummy1].FinalRideHeight;
                }

                oc[dummy1].FinalRideHeight_ForTrans = (oc[dummy1].scmOP.W1y) - l_RideHeightRefy + (_vehicleForMcPherson.CW[Identifier - 1] / tire.TireRate); // This value of Ride will represent represent the relative and not absolute value of Ride Height.

                // This is necessary to translate all the coordinate to the ground by an amount equal to the negative of Ride Height

                //if (!RecalculateSteering)
                //{
                //Re-assigning the the new coordinates to initial coordinates so that the loop carries on
                AssignLocalCoordinateVariables_MovingPoints(oc[dummy1].scmOP);
                L1x = oc[dummy1].scmOP.L1x; L1y = oc[dummy1].scmOP.L1y; L1z = oc[dummy1].scmOP.L1z;
                //}

                if ((MotionExists) && dummy1 != 0 && (Identifier != 3 && Identifier != 4) && (_vehicleForMcPherson.vehicle_Motion.SteeringExists))
                {
                    ///<summary>
                    ///This IF loop takes care of 2 things and is used ONLY for the Front in the event of SteeringExists is true
                    ///Calculating the new Spindel End, Steering Upright and Contact Patch Coordinates which is done inside the IF part of the loop
                    ///Calculating the Outboard and Inboard Points Seperately for the Front.
                    /// </summary>

                    if (!RecalculateSteering)
                    {
                        //
                        //Calculating the new coordinates of the Toe Rod Inboard and Outboard End
                        //
                        ToeRod_Steering(oc[dummy1], dummy1, _vehicleForMcPherson, wa);

                        //
                        // Calculating the Delta Camber due to steering
                        //
                        CalculateDCamberDToe_Steering(oc[dummy1], _vehicleForMcPherson, dummy1);

                        //
                        // Calculating the New Camber due to Steering
                        //
                        CalculateNewCamberAndToe_Steering(oc, dummy1, _vehicleForMcPherson);

                        //
                        // Calculating the new Wheel Spindle End due to Steering
                        //
                        RotateSpindleVector(dCamber_Steering, dToe_Steering, true, l_J1x, l_J1y, l_J1z, l_E1x, l_E1y, l_E1z, L1x, L1y, L1z, out oc[dummy1].scmOP.L1x, out oc[dummy1].scmOP.L1y, out oc[dummy1].scmOP.L1z);

                        //
                        //Recalculting the Contact Patch due to steering
                        //
                        ContactPatch_Steering(oc[dummy1]);
                        double DeltaWheelDef_Steering;
                        DeltaWheelDef_Steering = oc[dummy1].scmOP.W1y - l_W1y;
                        scm.WheelDeflection_Steering[dummy1] = -DeltaWheelDef_Steering;
                    }
                    else
                    {
                        /////<remarks>
                        /////Call for the finding the new coordinates of the Outboard points will be made here
                        ///// </remarks>
                        //WheelCentre_Steering(oc, _vehicleKinematicsDWSolver, dummy1);

                        //UBJandLBJ_Steering(oc, dummy1);

                        //Pushrod_Steering(oc, dummy1);
                    }

                    //CalculateSpringDeflection_ForSteering_Front(oc,Identifier, DeltaWheelDef_Steering, oc[dummy1].FinalMR, dummy1);
                    //CalculateAngleOfRotationOrDamperLength(oc[dummy1], MotionExists, dummy1, damper);

                    //InitializeRotationMatrices(Identifier, oc[dummy1]);
                    //BellCrankPoints(oc[dummy1]);

                    l_M1x = oc[dummy1].scmOP.M1x; l_M1y = oc[dummy1].scmOP.M1y; l_M1z = oc[dummy1].scmOP.M1z;

                    AssignLocalCoordinateVariables_MovingPoints(oc[dummy1].scmOP);
                    L1x = oc[dummy1].scmOP.L1x; L1y = oc[dummy1].scmOP.L1y; L1z = oc[dummy1].scmOP.L1z;
                }

                _vehicleForMcPherson.SuspensionIsSolved = true;

                if (MotionExists)
                {
                    dummy1++;
                }
            }

            #endregion

            #region Initializing loop variables for other Outputs
            if (MotionExists)
            {
                N      = _vehicleForMcPherson.vehicle_Motion.Final_WheelDeflectionsY.Count;
                dummy2 = 0;
            }
            else if (!MotionExists)
            {
                N      = 200;
                dummy2 = 0;
            }
            #endregion

            #region For Loop for other Outputs

            for (a1 = 1; a1 < N; a1++)
            {
                // This variable keeps track of the total value or magnitude of the Spring Deflection.
                oc[dummy2].Corrected_SpringDeflection_1 += oc[dummy2].Corrected_SpringDeflection; // This
                                                                                                  // This variable keeps track of the total value or magnitude of the Spring Deflection.
                oc[dummy2].Corrected_WheelDeflection_1 = oc[dummy2].Corrected_WheelDeflection - oc[dummy2].Corrected_WheelDeflection_1;


                if (dummy2 != 0 && ((MotionExists) && ((Identifier == 3 || Identifier == 4) || ((Identifier == 1 || Identifier == 2) && (!_vehicleForMcPherson.vehicle_Motion.SteeringExists)))))
                {
                    CalculatenewCamberAndToe_Rear(oc, dummy2, _vehicleForMcPherson, Identifier);
                }
                else if (!MotionExists)
                {
                    CalculatenewCamberAndToe_Rear(oc, dummy2, _vehicleForMcPherson, Identifier);
                }



                #region Coordinate Translations
                ///<remarks>
                ///Need this if loop here because otherwise, this will Vehicle will be translated by the InputOrigin as many times as there are for loops
                /// </remarks>
                if (MotionExists)
                {
                    TranslateToRequiredCS(scm, oc[dummy2], _vehicleForMcPherson, MotionExists, 0, 0, 0, 0, 0, 0);
                }
                else if (!MotionExists)
                {
                    TranslateToRequiredCS(scm, oc[dummy2], _vehicleForMcPherson, MotionExists, _vehicleForMcPherson.sc_FL.InputOriginX, _vehicleForMcPherson.sc_FL.InputOriginY, _vehicleForMcPherson.sc_FL.InputOriginZ,
                                          _vehicleForMcPherson.OutputOrigin_x, _vehicleForMcPherson.OutputOrigin_y, _vehicleForMcPherson.OutputOrigin_z);
                }
                #endregion


                //New Non Suspended Mass CG Calculation
                oc[dummy2].New_NonSuspendedMassCoGx = (oc[dummy2].scmOP.K1x + oc[dummy2].scmOP.L1x) / 2;
                oc[dummy2].New_NonSuspendedMassCoGy = (oc[dummy2].scmOP.K1y + oc[dummy2].scmOP.L1y) / 2;
                oc[dummy2].New_NonSuspendedMassCoGz = (oc[dummy2].scmOP.K1z + oc[dummy2].scmOP.L1z) / 2;

                //// Passing the Corner Weight to the Outputclass
                //oc[dummy2].CW = _vehicleForMcPherson.CW[Identifier - 1];
                //oc[dummy2].CW_1 = _vehicleForMcPherson.CW[Identifier - 1];

                #region Passing the Motion Ratio to the Output Class
                oc[dummy2].InitialMR      = scm.InitialMR;
                oc[dummy2].Initial_ARB_MR = scm.Initial_ARB_MR;
                #endregion

                //Calculating the Suspension Wishbone Forces
                //Unit Vectors
                double UV_D2E2x, UV_D2E2y, UV_D2E2z, UV_C2E2x, UV_C2E2y, UV_C2E2z, UV_M2N2x, UV_M2N2y, UV_M2N2z, UV_J2Jox, UV_J2Joy, UV_J2Joz;

                //Calculating the Unit vectors
                UV_D2E2x = (oc[dummy2].scmOP.D1x - oc[dummy2].scmOP.E1x) / scm.LowerFrontLength;
                UV_D2E2y = (oc[dummy2].scmOP.D1y - oc[dummy2].scmOP.E1y) / scm.LowerFrontLength;
                UV_D2E2z = (oc[dummy2].scmOP.D1z - oc[dummy2].scmOP.E1z) / scm.LowerFrontLength;
                UV_C2E2x = (oc[dummy2].scmOP.C1x - oc[dummy2].scmOP.E1x) / scm.LowerRearLength;
                UV_C2E2y = (oc[dummy2].scmOP.C1y - oc[dummy2].scmOP.E1y) / scm.LowerRearLength;
                UV_C2E2z = (oc[dummy2].scmOP.C1z - oc[dummy2].scmOP.E1z) / scm.LowerRearLength;
                UV_M2N2x = (oc[dummy2].scmOP.N1x - oc[dummy2].scmOP.M1x) / scm.ToeLinkLength;
                UV_M2N2y = (oc[dummy2].scmOP.N1y - oc[dummy2].scmOP.M1y) / scm.ToeLinkLength;
                UV_M2N2z = (oc[dummy2].scmOP.N1z - oc[dummy2].scmOP.M1z) / scm.ToeLinkLength;
                UV_J2Jox = (oc[dummy2].scmOP.JO1x - oc[dummy2].scmOP.J1x) / scm.PushRodLength;
                UV_J2Joy = (oc[dummy2].scmOP.JO1y - oc[dummy2].scmOP.J1y) / scm.PushRodLength;
                UV_J2Joz = (oc[dummy2].scmOP.JO1z - oc[dummy2].scmOP.J1z) / scm.PushRodLength;

                // Matrix A - Unit Vectors and Cross Products

                double[,] matrixa;
                matrixa       = new double[3, 3];
                matrixa[0, 0] = UV_D2E2x;
                matrixa[1, 0] = UV_D2E2y;
                matrixa[2, 0] = UV_D2E2z;
                matrixa[0, 1] = UV_C2E2x;
                matrixa[1, 1] = UV_C2E2y;
                matrixa[2, 1] = UV_C2E2z;
                matrixa[0, 2] = UV_M2N2x;
                matrixa[1, 2] = UV_M2N2y;
                matrixa[2, 2] = UV_M2N2z;

                //Unit Matrix
                double[,] unitmatrixa;
                unitmatrixa = new double[3, 3];
                for (i = 0; i < 3; ++i)
                {
                    for (j = 0; j < 6; ++j)
                    {
                        if (j == i)
                        {
                            unitmatrixa[i, j] = 1;
                        }
                    }
                }

                //Pseudo Matrix
                double psuedo, psuedo2;

                //Inverse of Matrix A
                for (j = 0; j < 3; j++)
                {
                    psuedo = matrixa[j, j];

                    for (i = 0; i < 3; i++)
                    {
                        matrixa[j, i]     = matrixa[j, i] / psuedo;
                        unitmatrixa[j, i] = unitmatrixa[j, i] / psuedo;
                    }

                    for (k = 0; k < 3; k++)
                    {
                        if (k == j)
                        {
                        }
                        else
                        {
                            psuedo2 = matrixa[k, j];
                            for (i = 0; i < 3; i++)
                            {
                                matrixa[k, i]     = matrixa[k, i] - (matrixa[j, i] * psuedo2);
                                unitmatrixa[k, i] = unitmatrixa[k, i] - (unitmatrixa[j, i] * psuedo2);
                            }
                        }
                    }
                }


                //Forces and Moments generated by the Front Left Tire (Considering Braking + Left Turn)
                double LatF, LongF, MOMx, MOMy, MOMz;
                LatF  = LatForce;
                LongF = LongForce;
                MOMx  = ((LongF * oc[dummy2].scmOP.W1y / 1000) - (oc[dummy2].scmOP.W1z * (oc[dummy2].CW + VerticalForce) / 1000));
                ///<remarks>
                /// Y axis for my software is the vertixal Axis so I have added Mz to the Moment about the Y Axis as Mz is the Moment about the vertical axis as defined by the User
                /// </remarks>
                MOMy = ((LatF * oc[dummy2].scmOP.W1z / 1000) - (LongF * oc[dummy2].scmOP.W1x / 1000)) + Mz;
                ///<remarks>
                ///Z axis for my software is the Longitudinal Axis so I have added Mx to the Moment about the Z Axis as Mx is the Moment about the Longitudinal axis as defined by the User
                ///</remarks>
                MOMz = (((oc[dummy2].CW + VerticalForce) * oc[dummy2].scmOP.W1x / 1000) - (LatF * oc[dummy2].scmOP.W1y / 1000)) + Mx;

                //Matrx B
                double[,] matrixb;
                matrixb       = new double[3, 1];
                matrixb[0, 0] = LatF;
                ///<remarks>The <c>oc[dummy2].deltaNet_CornerWeight</c> is already included in the <c>oc[dummy2].CW</c> <seealso cref="VehicleModel.ComputeVehicleModel_SummationOfResults(Vehicle)"/> </remarks>
                matrixb[1, 0] = oc[dummy2].CW + (VerticalForce /*- oc[dummy2].deltaNet_CornerWeight*/);
                matrixb[2, 0] = LongF;


                //Matrix X
                double X;
                double[,] matrixX;
                matrixX = new double[3, 1];

                for (j = 0; j <= 2; j++)
                {
                    X = 0;
                    for (i = 0; i <= 2; i++)
                    {
                        X += (unitmatrixa[j, i] * matrixb[i, 0]);
                    }
                    matrixX[j, 0] = X;
                }


                oc[dummy2].LowerFront = (matrixX[0, 0]); // Lower Front
                oc[dummy2].LowerRear  = (matrixX[1, 0]); // Lower Rear
                oc[dummy2].ToeLink    = (matrixX[2, 0]); // Toe Link
                oc[dummy2].PushRod    = (oc[dummy2].Corrected_SpringDeflection * spring.SpringRate);

                //Forces in Each Pick Up Points
                oc[dummy2].LowerFront_x = oc[dummy2].LowerFront * UV_D2E2x;
                oc[dummy2].LowerFront_y = oc[dummy2].LowerFront * UV_D2E2y;
                oc[dummy2].LowerFront_z = oc[dummy2].LowerFront * UV_D2E2z;
                oc[dummy2].LowerRear_x  = oc[dummy2].LowerRear * UV_C2E2x;
                oc[dummy2].LowerRear_y  = oc[dummy2].LowerRear * UV_C2E2y;
                oc[dummy2].LowerRear_z  = oc[dummy2].LowerRear * UV_C2E2z;
                oc[dummy2].ToeLink_x    = oc[dummy2].ToeLink * UV_M2N2x;
                oc[dummy2].ToeLink_y    = oc[dummy2].ToeLink * UV_M2N2y;
                oc[dummy2].ToeLink_z    = oc[dummy2].ToeLink * UV_M2N2z;
                oc[dummy2].PushRod_x    = oc[dummy2].PushRod * UV_J2Jox;
                oc[dummy2].PushRod_y    = oc[dummy2].PushRod * UV_J2Joy;
                oc[dummy2].PushRod_z    = oc[dummy2].PushRod * UV_J2Joz;

                if (MotionExists)
                {
                    dummy2++;
                }
            }

            #endregion
        }
コード例 #11
0
        public static void TranslateCoordinates_To_AnyCS(SuspensionCoordinatesMaster _scmTrans, double trans_X, double trans_Y, double trans_Z)
        {
            #region Converting the points back to the INPUT Coordinate System
            ///<summary>
            ///Translating the Fixed Points to the required Coordinate System
            /// </summary>
            ///<summary>
            ///Chassis Pick up of Lower Wishbone
            /// </summary>
            _scmTrans.A1x += trans_X; _scmTrans.B1x += trans_X;
            ///<summary>
            ///Chassis Pick Up of Upper Wishbone
            /// </summary>
            _scmTrans.C1x += trans_X; _scmTrans.D1x += trans_X;
            ///<summary>
            ///Bell-Crank Pivot and Damper Chassis Pick Up
            /// </summary>
            _scmTrans.I1x += trans_X; _scmTrans.JO1x += trans_X;
            ///<summary>
            ///Steering Chassis and ARB Chassis
            /// </summary>
            _scmTrans.N1x += /* l_N1x*/ trans_X; _scmTrans.Q1x += trans_X;
            ///<summary>
            ///T-ARB Pick Chassis Mount (IF T-ARB exists)
            /// </summary>
            _scmTrans.R1x += trans_X;
            ///<summary>
            ///Pinion, 1st UV, 2nd UV (if exists) and Steering Column Chassis
            /// </summary>
            _scmTrans.Pin1x += /* l_Pin1x*/ trans_X;
            _scmTrans.UV1x  += /* l_UV1x*/ trans_X;
            _scmTrans.UV2x  += /* l_UV2x*/ trans_X;
            _scmTrans.STC1x += /* l_STC1x*/ trans_X;

            ///<summary>
            ///Chassis Pick up of Lower Wishbone
            /// </summary>
            _scmTrans.A1y += trans_Y; _scmTrans.B1y += trans_Y;
            ///<summary>
            ///Chassis Pick Up of Upper Wishbone
            /// </summary>
            _scmTrans.C1y += trans_Y; _scmTrans.D1y += trans_Y;
            ///<summary>
            ///Bell-Crank Pivot and Damper Chassis Pick Up
            /// </summary>
            _scmTrans.I1y += trans_Y; _scmTrans.JO1y += trans_Y;
            ///<summary>
            ///Steering Chassis and ARB Chassis
            /// </summary>
            _scmTrans.N1y += /*l_N1y*/ trans_Y; _scmTrans.Q1y += trans_Y;
            ///<summary>
            ///T-ARB Pick Chassis Mount (IF T-ARB exists)
            /// </summary>
            _scmTrans.R1y += trans_Y;
            ///<summary>
            ///Pinion, 1st UV, 2nd UV (if exists) and Steering Column Chassis
            /// </summary>
            _scmTrans.Pin1y += /*l_Pin1y*/ trans_Y;
            _scmTrans.UV1y  += /*l_UV1y*/ trans_Y;
            _scmTrans.UV2y  += /*l_UV2y*/ trans_Y;
            _scmTrans.STC1y += /*l_STC1y*/ trans_Y;

            ///<summary>
            ///Chassis Pick up of Lower Wishbone
            /// </summary>
            _scmTrans.A1z += trans_Z; _scmTrans.B1z += trans_Z;
            ///<summary>
            ///Chassis Pick Up of Upper Wishbone
            /// </summary>
            _scmTrans.C1z += trans_Z; _scmTrans.D1z += trans_Z;
            ///<summary>
            ///Bell-Crank Pivot and Damper Chassis Pick Up
            /// </summary>
            _scmTrans.I1z += trans_Z; _scmTrans.JO1z += trans_Z;
            ///<summary>
            ///Steering Chassis and ARB Chassis
            /// </summary>
            _scmTrans.N1z += /*l_N1z*/ trans_Z; _scmTrans.Q1z += trans_Z;
            ///<summary>
            ///T-ARB Pick Chassis Mount (IF T-ARB exists)
            /// </summary>
            _scmTrans.R1z += trans_Z;
            ///<summary>
            ///Pinion, 1st UV, 2nd UV (if exists) and Steering Column Chassis
            /// </summary>
            _scmTrans.Pin1z += /*l_Pin1z*/ trans_Z;
            _scmTrans.UV1z  += /*l_UV1z*/ trans_Z;
            _scmTrans.UV2z  += /*l_UV2z*/ trans_Z;
            _scmTrans.STC1z += /*l_STC1z*/ trans_Z;



            ///<summary>
            ///Moving Points
            /// </summary>
            _scmTrans.J1x += trans_X; _scmTrans.H1x += trans_X;
            _scmTrans.O1x += trans_X; _scmTrans.G1x += trans_X;
            _scmTrans.F1x += trans_X; _scmTrans.E1x += trans_X;
            _scmTrans.M1x += trans_X; _scmTrans.K1x += trans_X;
            _scmTrans.L1x += trans_X; _scmTrans.P1x += trans_X;
            _scmTrans.W1x += trans_X;

            _scmTrans.J1y += trans_Y; _scmTrans.H1y += trans_Y;
            _scmTrans.O1y += trans_Y; _scmTrans.G1y += trans_Y;
            _scmTrans.F1y += trans_Y; _scmTrans.E1y += trans_Y;
            _scmTrans.M1y += trans_Y; _scmTrans.K1y += trans_Y;
            _scmTrans.L1y += trans_Y; _scmTrans.P1y += trans_Y;
            _scmTrans.W1y += trans_Y;

            _scmTrans.J1z += trans_Z; _scmTrans.H1z += trans_Z;
            _scmTrans.O1z += trans_Z; _scmTrans.G1z += trans_Z;
            _scmTrans.F1z += trans_Z; _scmTrans.E1z += trans_Z;
            _scmTrans.M1z += trans_Z; _scmTrans.K1z += trans_Z;
            _scmTrans.L1z += trans_Z; _scmTrans.P1z += trans_Z;
            _scmTrans.W1z += trans_Z;
            #endregion
        }
コード例 #12
0
        private void PlotSuspension(SuspensionCoordinatesMaster _scmPlot)
        {
            #region Joints
            viewportLayout1.Entities.Add(new Joint(_scmPlot.A1x, _scmPlot.A1y, _scmPlot.A1z, 2.5, 2), 1);
            viewportLayout1.Entities.Add(new Joint(_scmPlot.B1x, _scmPlot.B1y, _scmPlot.B1z, 2.5, 2), 1);
            viewportLayout1.Entities.Add(new Joint(_scmPlot.C1x, _scmPlot.C1y, _scmPlot.C1z, 2.5, 2), 1);
            viewportLayout1.Entities.Add(new Joint(_scmPlot.D1x, _scmPlot.D1y, _scmPlot.D1z, 2.5, 2), 1);
            viewportLayout1.Entities.Add(new Joint(_scmPlot.E1x, _scmPlot.E1y, _scmPlot.E1z, 2.5, 2), 1);
            viewportLayout1.Entities.Add(new Joint(_scmPlot.F1x, _scmPlot.F1y, _scmPlot.F1z, 2.5, 2), 1);
            viewportLayout1.Entities.Add(new Joint(_scmPlot.G1x, _scmPlot.G1y, _scmPlot.G1z, 2.5, 2), 1);
            viewportLayout1.Entities.Add(new Joint(_scmPlot.H1x, _scmPlot.H1y, _scmPlot.H1z, 2.5, 2), 1);
            viewportLayout1.Entities.Add(new Joint(_scmPlot.I1x, _scmPlot.I1y, _scmPlot.I1z, 2.5, 2), 1);
            viewportLayout1.Entities.Add(new Joint(_scmPlot.J1x, _scmPlot.J1y, _scmPlot.J1z, 2.5, 2), 1);
            viewportLayout1.Entities.Add(new Joint(_scmPlot.JO1x, _scmPlot.JO1y, _scmPlot.JO1z, 2.5, 2), 1);
            viewportLayout1.Entities.Add(new Joint(_scmPlot.K1x, _scmPlot.K1y, _scmPlot.K1z, 2.5, 2), 1);
            viewportLayout1.Entities.Add(new Joint(_scmPlot.M1x, _scmPlot.M1y, _scmPlot.M1z, 2.5, 2), 1);
            viewportLayout1.Entities.Add(new Joint(_scmPlot.N1x, _scmPlot.N1y, _scmPlot.N1z, 2.5, 2), 1);
            viewportLayout1.Entities.Add(new Joint(_scmPlot.O1x, _scmPlot.O1y, _scmPlot.O1z, 2.5, 2), 1);
            viewportLayout1.Entities.Add(new Joint(_scmPlot.P1x, _scmPlot.P1y, _scmPlot.P1z, 2.5, 2), 1);
            viewportLayout1.Entities.Add(new Joint(_scmPlot.Q1x, _scmPlot.Q1y, _scmPlot.Q1z, 2.5, 2), 1);
            viewportLayout1.Entities.Add(new Joint(_scmPlot.R1x, _scmPlot.R1y, _scmPlot.R1z, 2.5, 2), 1);
            viewportLayout1.Entities.Add(new Joint(_scmPlot.W1x, _scmPlot.W1y, _scmPlot.W1z, 2.5, 2), 1);
            #endregion

            #region Bars and Trianlges
            viewportLayout1.Entities.Add(new Bar(_scmPlot.F1x, _scmPlot.F1y, _scmPlot.F1z, _scmPlot.A1x, _scmPlot.A1y, _scmPlot.A1z, 1, 8), 2);
            viewportLayout1.Entities.Add(new Bar(_scmPlot.F1x, _scmPlot.F1y, _scmPlot.F1z, _scmPlot.B1x, _scmPlot.B1y, _scmPlot.B1z, 1, 8), 2);

            viewportLayout1.Entities.Add(new Bar(_scmPlot.E1x, _scmPlot.E1y, _scmPlot.E1z, _scmPlot.C1x, _scmPlot.C1y, _scmPlot.C1z, 1, 8), 2);
            viewportLayout1.Entities.Add(new Bar(_scmPlot.E1x, _scmPlot.E1y, _scmPlot.E1z, _scmPlot.D1x, _scmPlot.D1y, _scmPlot.D1z, 1, 8), 2);

            viewportLayout1.Entities.Add(new Bar(_scmPlot.G1x, _scmPlot.G1y, _scmPlot.G1z, _scmPlot.H1x, _scmPlot.H1y, _scmPlot.H1z, 1, 8), 2);

            viewportLayout1.Entities.Add(new Bar(_scmPlot.M1x, _scmPlot.M1y, _scmPlot.M1z, _scmPlot.N1x, _scmPlot.N1y, _scmPlot.N1z, 1, 8), 2);

            Vector3D bellCrankTriangle_I = new Vector3D(_scmPlot.I1x, _scmPlot.I1y, _scmPlot.I1z);
            Vector3D bellCrankTriangle_J = new Vector3D(_scmPlot.J1x, _scmPlot.J1y, _scmPlot.J1z);
            Vector3D bellCrankTriangle_H = new Vector3D(_scmPlot.H1x, _scmPlot.H1y, _scmPlot.H1z);
            Vector3D bellCrankTriangle_O = new Vector3D(_scmPlot.O1x, _scmPlot.O1y, _scmPlot.O1z);
            viewportLayout1.Entities.Add(new Quad(bellCrankTriangle_I, bellCrankTriangle_J, bellCrankTriangle_H, bellCrankTriangle_O), 4, Color.Orange);

            viewportLayout1.Entities.Add(new Bar(_scmPlot.I1x, _scmPlot.I1y, _scmPlot.I1z, _scmPlot.J1x, _scmPlot.J1y, _scmPlot.J1z, 1, 8), 2);
            viewportLayout1.Entities.Add(new Bar(_scmPlot.I1x, _scmPlot.I1y, _scmPlot.I1z, _scmPlot.H1x, _scmPlot.H1y, _scmPlot.H1z, 1, 8), 2);
            viewportLayout1.Entities.Add(new Bar(_scmPlot.I1x, _scmPlot.I1y, _scmPlot.I1z, _scmPlot.O1x, _scmPlot.O1y, _scmPlot.O1z, 1, 8), 2);

            viewportLayout1.Entities.Add(new Bar(_scmPlot.J1x, _scmPlot.J1y, _scmPlot.J1z, _scmPlot.JO1x, _scmPlot.JO1y, _scmPlot.JO1z, 1, 8), 2);

            viewportLayout1.Entities.Add(new Bar(_scmPlot.P1x, _scmPlot.P1y, _scmPlot.P1z, _scmPlot.O1x, _scmPlot.O1y, _scmPlot.O1z, 1, 8), 2);
            viewportLayout1.Entities.Add(new Bar(_scmPlot.P1x, _scmPlot.P1y, _scmPlot.P1z, _scmPlot.Q1x, _scmPlot.Q1y, _scmPlot.Q1z, 1, 8), 2);

            Vector3D tV1 = new Vector3D(_scmPlot.E1x, _scmPlot.E1y, _scmPlot.E1z);
            Vector3D tV2 = new Vector3D(_scmPlot.F1x, _scmPlot.F1y, _scmPlot.F1z);
            Vector3D tV3 = new Vector3D(_scmPlot.M1x, _scmPlot.M1y, _scmPlot.M1z);

            viewportLayout1.Entities.Add(new Triangle(tV1, tV2, tV3), 3, Color.Orange);
            #endregion

            #region Drawing the Spring
            Solid spring = new Solid();
            spring = Solid.CreateSpring(1, 0.5, 5, 10, 1, 5, false);
            //Point3D sP1 = new Point3D(_scmPlot.J1x, _scmPlot.J1y, _scmPlot.J1z);
            Vector3D sTV = new Vector3D(_scmPlot.JO1x, _scmPlot.JO1y, _scmPlot.JO1z);
            spring.Translate(sTV);
            Point3D[] sP = new Point3D[2];
            //sP[0] = sP1;
            //sP[1] = sP2;
            sP = spring.Vertices;


            viewportLayout1.Entities.Add(spring);
            #endregion

            #region Drawing the Wheel
            Solid wheel = new Solid();
            wheel = Solid.CreateTorus(457.2 / 2, 85, 100, 100);
            Vector3D wTV = new Vector3D(_scmPlot.K1x, _scmPlot.K1y, _scmPlot.K1z);
            Point3D  wP1 = new Point3D(_scmPlot.W1x, _scmPlot.W1y, _scmPlot.W1z);
            Point3D  wP2 = new Point3D(_scmPlot.W1x, _scmPlot.W1y + 100, _scmPlot.W1z);
            Vector3D wRV = new Vector3D(wP1, wP2);
            wheel.Rotate(Math.PI / 2, wRV);
            wheel.Translate(wTV);

            viewportLayout1.Entities.Add(wheel);
            #endregion
        }
コード例 #13
0
        public void Clone(SuspensionCoordinatesMaster _scMajor)
        {
            A1x = _scMajor.A1x;
            A1y = _scMajor.A1y;
            A1z = _scMajor.A1z;

            B1x = _scMajor.B1x;
            B1y = _scMajor.B1y;
            B1z = _scMajor.B1z;

            C1x = _scMajor.C1x;
            C1y = _scMajor.C1y;
            C1z = _scMajor.C1z;

            D1x = _scMajor.D1x;
            D1y = _scMajor.D1y;
            D1z = _scMajor.D1z;

            E1x = _scMajor.E1x;
            E1y = _scMajor.E1y;
            E1z = _scMajor.E1z;

            F1x = _scMajor.F1x;
            F1y = _scMajor.F1y;
            F1z = _scMajor.F1z;

            G1x = _scMajor.G1x;
            G1y = _scMajor.G1y;
            G1z = _scMajor.G1z;

            H1x = _scMajor.H1x;
            H1y = _scMajor.H1y;
            H1z = _scMajor.H1z;

            I1x = _scMajor.I1x;
            I1y = _scMajor.I1y;
            I1z = _scMajor.I1z;

            JO1x = _scMajor.JO1x;
            JO1y = _scMajor.JO1y;
            JO1z = _scMajor.JO1z;

            J1x = _scMajor.J1x;
            J1y = _scMajor.J1y;
            J1z = _scMajor.J1z;

            K1x = _scMajor.K1x;
            K1y = _scMajor.K1y;
            K1z = _scMajor.K1z;

            L1x = _scMajor.L1x;
            L1y = _scMajor.L1y;
            L1z = _scMajor.L1z;

            M1x = _scMajor.M1x;
            M1y = _scMajor.M1y;
            M1z = _scMajor.M1z;

            N1x = _scMajor.N1x;
            N1y = _scMajor.N1y;
            N1z = _scMajor.N1z;

            O1x = _scMajor.O1x;
            O1y = _scMajor.O1y;
            O1z = _scMajor.O1z;

            P1x = _scMajor.P1x;
            P1y = _scMajor.P1y;
            P1z = _scMajor.P1z;

            Q1x = _scMajor.Q1x;
            Q1y = _scMajor.Q1y;
            Q1z = _scMajor.Q1z;

            R1x = _scMajor.R1x;
            R1y = _scMajor.R1y;
            R1z = _scMajor.R1z;

            W1x = _scMajor.W1x;
            W1y = _scMajor.W1y;
            W1z = _scMajor.W1z;

            Pin1x = _scMajor.Pin1x;
            Pin1y = _scMajor.Pin1y;
            Pin1z = _scMajor.Pin1z;

            UV1x = _scMajor.UV1x;
            UV1y = _scMajor.UV1y;
            UV1z = _scMajor.UV1z;


            UV2x = _scMajor.UV2x;
            UV2y = _scMajor.UV2y;
            UV2z = _scMajor.UV2z;

            STC1x = _scMajor.STC1x;
            STC1y = _scMajor.STC1y;
            STC1z = _scMajor.STC1z;

            RideHeightRefx = _scMajor.RideHeightRefx;
            RideHeightRefy = _scMajor.RideHeightRefy;
            RideHeightRefz = _scMajor.RideHeightRefz;
        }