Ejemplo n.º 1
0
        /// <summary>
        /// Read the flow sensor
        /// </summary>
        /// <remarks>
        /// Engineering Notes: This step is to check if the reading of flow sensor is reasonable.
        /// With the pump closed and all valves closed, the flow should be lower than a certain level.
        /// Failure on this indicates the reading of flow rate is not correct.
        /// </remarks>
        /// <param name="details">The string to hold details.</param>
        private void TestFlowSensor( DetailsBuilder details )
        {
            Pump.CloseAllValves( true );
            Pump.Stop();
            Thread.Sleep( 500 ); // Give the valves a chance to finish closing

            // Read the flow rate.
            ushort rawFlowCount = Pump.GetRawFlow();
            ushort flowVolts = Pump.ConvertRawFlowToVolts( rawFlowCount );
            ushort vacuumCounts = Pump.GetRawVacuum();
            double vacuumInches = Pump.ConvertRawVacuumToInches( vacuumCounts );
            int flowRate = Pump.CalculateFlowRate( flowVolts, vacuumCounts );

            // Test flow reading
            string flowString = BuildFlowString( rawFlowCount, flowRate, flowVolts );
            _gdpList.Add( new GeneralDiagnosticProperty( "DIAGNOSTIC_FLOW", rawFlowCount.ToString() ) );
            _gdpList.Add( new GeneralDiagnosticProperty( "DIAGNOSTIC_FLOW_VOLTS", flowVolts.ToString() ) );
            _gdpList.Add( new GeneralDiagnosticProperty( "DIAGNOSTIC_FLOW_RATE", flowRate.ToString() ) );
            _gdpList.Add( new GeneralDiagnosticProperty( "DIAGNOSTIC_FLOW_VACUUM", vacuumCounts.ToString() ) );
            _gdpList.Add( new GeneralDiagnosticProperty( "DIAGNOSTIC_FLOW_VACUUM_INCHES", vacuumInches.ToString() ) );

            // Flow value should be in the range of 0 (0mV) to 186 (600 mV), inclusive.
            // INS-3067, 6/26/2013, JMP - changer criteria from 43/128 to 0/186.
            ReportDiagnostic( details, DiagnosticResources.FLOW, flowString, ( ( rawFlowCount < 0 ) || ( rawFlowCount > 186 ) ) );
        }
Ejemplo n.º 2
0
 public virtual ushort GetRawFlow()
 {
     return(Pump.GetRawFlow());
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Check if pump works properly.
        /// </summary>
        /// <remarks>
        /// Engineering Notes: This step is to check if pump works properly.
        /// Run pump at two different control voltages, check the flow rate difference between these two cases.
        /// </remarks>
        /// <param name="details">The string to hold details.</param>
        private void TestPump(DetailsBuilder details)
        {
            // Find a port without a gas cylinder connected. 
            // If all ports are connected, skip this test.
            DockingStation ds = Controller.GetDockingStation();

            // First, see if port one is unconnected or is providing FRESH AIR
            // Note: we are trying ports in the order of 3-2-1 so as to avoid pulling air through the filter, if possible.
            int testPort = -1;
            GasEndPoint gasEndPoint = null;
            for ( int solenoid = Configuration.DockingStation.NumGasPorts; solenoid >= 1 && testPort <= 0; solenoid-- )
            {
                gasEndPoint = ds.GasEndPoints.Find(m => m.Position == solenoid);
                if (gasEndPoint == null || gasEndPoint.Cylinder.IsFreshAir)
                    testPort = solenoid;
            }

            if (testPort <= 0)
            {
                Log.Debug("TestPump:  could not find open solenoid; this test will be skipped.");
                return;
            }

            // Open solenoid valve determined to be unconnected
            Pump.CloseAllValves( true );
            Thread.Sleep(500); // Give the valves a chance to finish closing
            Pump.OpenValve(testPort, false);

            // Start pump with pump voltage of 80
            Pump.Start(80);

            // Wait 3 seconds
            Thread.Sleep(3000);

            // Read flow 1
            ushort flowCount1 = Pump.GetRawFlow();
            ushort flowVolts1 = Pump.ConvertRawFlowToVolts( flowCount1 );
            ushort vacuumCounts1 = Pump.GetRawVacuum();

            int flowRate1 = Pump.CalculateFlowRate( flowVolts1, vacuumCounts1 );
            string flowString1 = BuildFlowString(flowCount1, flowRate1, flowVolts1);

            // Increase pump voltage to 240
            Pump.SetNewPumpVoltage(240);

            // Wait 3 seconds
            Thread.Sleep(3000);

            // Check Pump Error status
            int pumpErrorState = Pump.GetPumpErrorState();

            // Fail if state is 1
            _gdpList.Add(new GeneralDiagnosticProperty("DIAGNOSTIC_PUMP_ERROR_STATUS", pumpErrorState.ToString()));
            ReportDiagnostic(details, DiagnosticResources.PUMP_ERROR_STATUS, pumpErrorState.ToString(), (pumpErrorState == 1));

            // Read flow 2
            ushort flowCount2 = Pump.GetRawFlow();
            ushort flowVolts2 = Pump.ConvertRawFlowToVolts( flowCount2 );
            ushort vacuumCounts2 = Pump.GetRawVacuum();
            int flowRate2 = Pump.CalculateFlowRate( flowVolts2, vacuumCounts2 );
            string flowString2 = BuildFlowString(flowCount2, flowRate2, flowVolts2);

            // Fail if f2 - f1 < 100 OR f2 - f1 > 450
            _gdpList.Add(new GeneralDiagnosticProperty("DIAGNOSTIC_PUMP_F1", flowCount1.ToString()));
            _gdpList.Add(new GeneralDiagnosticProperty("DIAGNOSTIC_PUMP_F2", flowCount2.ToString()));
            ReportDiagnostic(details, DiagnosticResources.PUMP, flowString1, flowString2, ( flowCount2 - flowCount1 < 100 ) || ( flowCount2 - flowCount1 > 450 ) );

            // Stop the pump and close the port used for this test
            Pump.CloseValve(testPort);
            Thread.Sleep(500);
        }