Example #1
0
        /// <summary>
        /// Creates motor driven axle class instance
        /// - sets TransmissionEfficiency to 0.99 (99%)
        /// - sets SlipWarningThresholdPercent to 70%
        /// - sets axle DriveType to MotorDriven
        /// - updates totalInertiaKgm2 parameter
        /// </summary>
        /// <param name="electricMotor">Electric motor connected with the axle</param>
        public Axle(ElectricMotor electricMotor)
        {
            motor = electricMotor;
            motor.AxleConnected    = this;
            transmissionEfficiency = 0.99f;
            driveType = AxleDriveType.MotorDriven;
            AxleRevolutionsInt.IsLimited = true;
            Adhesion2 = 0.331455f;

            switch (driveType)
            {
            case AxleDriveType.NotDriven:
                totalInertiaKgm2 = inertiaKgm2;
                break;

            case AxleDriveType.MotorDriven:
                AxleRevolutionsInt.Max = 5000.0f;
                AxleRevolutionsInt.Min = -5000.0f;
                totalInertiaKgm2       = inertiaKgm2 + transmissionRatio * transmissionRatio * motor.InertiaKgm2;
                break;

            case AxleDriveType.ForceDriven:
                AxleRevolutionsInt.Max = 100.0f;
                AxleRevolutionsInt.Min = -100.0f;
                totalInertiaKgm2       = inertiaKgm2;
                break;

            default:
                totalInertiaKgm2 = inertiaKgm2;
                break;
            }
        }