public void test_MCU_Time_Estimate() { int vel = 170_000, dist = 10_000_000; int time = MCUManager.EstimateMovementTime(vel, dist); Assert.AreEqual(61800, time); }
public int RelativeMovementETA(Orientation movingBy) { // distance is degrees to steps for az/el // time is in milliseconds int EL_Speed = ConversionHelper.DPSToSPS(ConversionHelper.RPMToDPS(0.6), MotorConstants.GEARING_RATIO_ELEVATION); int AZ_Speed = ConversionHelper.DPSToSPS(ConversionHelper.RPMToDPS(0.6), MotorConstants.GEARING_RATIO_AZIMUTH); int positionTranslationAZ = ConversionHelper.DegreesToSteps(movingBy.Azimuth, MotorConstants.GEARING_RATIO_AZIMUTH); int positionTranslationEL = ConversionHelper.DegreesToSteps(movingBy.Elevation, MotorConstants.GEARING_RATIO_ELEVATION); int timeToMoveEl = MCUManager.EstimateMovementTime(EL_Speed, positionTranslationEL); int timeToMoveAz = MCUManager.EstimateMovementTime(AZ_Speed, positionTranslationAZ); // return the greater of the two times (we have to wait for longest mvmt) int timeToMove = timeToMoveEl > timeToMoveAz ? timeToMoveEl : timeToMoveAz; return(timeToMove); }